Questions tagged [physijs]

Physics plugin for JavaScript 3D library three.js

Physijs brings a very easy to use interface to the three.js framework.

One of the reasons three.js is so popular is because it is so incredibly easy for graphics newbies to get into 3D programming. Physijs takes that philosophy to heart and makes physics simulations just as easy to run.

70 questions
6
votes
3 answers

"physi.js" causes the error: "Script cannot be accessed from origin 'null'"

I was trying to play with physi.js library (). I followed all the steps given: https://github.com/chandlerprall/Physijs/wiki/Basic-Setup However, I got the error: Uncaught SecurityError: Failed to construct 'Worker': Script at…
Darius Miliauskas
  • 3,391
  • 4
  • 35
  • 53
5
votes
2 answers

Physijs, combining movement and physics

I've been looking around for a while now for a conclusion for this, but I seem to be unable to find any solution to this. I'm trying to create a simple scene to get a little platform action to work using THREE.JS and PHYSI.JS. I have one flat box…
5
votes
0 answers

Physijs object goes through concaveMesh

I've a problem that seems to be known: my "bounding" object doesn't collide with "floor" concaveMesh. I already read that this issue could be caused by an error in scaling concaveMesh together with the model, so I exported my floor model scaled as I…
Novagelida
  • 51
  • 3
4
votes
0 answers

Making Physijs take vertex shader displacements into account

I'm not sure if the title is the best, but I'll try to explain what my problem is. I'm playing aroung with Three.js and Physijs to make a simple game where the player can walk around on a field. I'm using a plane geometry as the ground and wanted to…
Lehooo
  • 41
  • 1
  • 4
3
votes
1 answer

Three.js PointerLockControls and Physisjs collision detection

I'm working on a Three.js project using PointerLockControls (full modified code). I'd like to implement collision detection for the playehr. I'm going about this by making a new Physijs cylinder object, and then passing it along with the camera to…
varis
  • 31
  • 2
3
votes
0 answers

FPS Demo Physi.js - Player sinking through floor

I am working on a FPS demo using three.js and physi.js (ammo physics) and I have a problem I can't solve. When I start the simulation and the player has not moved everything is good. When I move the player in any direction or jump, the player's mesh…
snowcap420
  • 91
  • 1
  • 11
3
votes
2 answers

add physics on blender model, three.js Physijs

How can i add physics on a blender model ? I tried ConvexMesh, ConcaveMesh but no luck. var mesh = {... blender exporter ...} var loader = new THREE.JSONLoader(); var mesh_obj = loader.parse(mesh,'./'); var mesh_materials = mesh_obj.materials; var…
2
votes
1 answer

Adding Physics to OBJ Model in ThreeJS

I am trying to use PhysiJS with ThreeJS. I have an OBJ model that I exported from Blender. When I load it with OBJLoader, I see that it is a BufferGeometry. I also notice that it is missing a vertices property, which is what PhysiJS looks for. My…
Daniel Hong
  • 93
  • 1
  • 7
2
votes
2 answers

Physijs-webpack library fails by require

In the web application I already have some packages declared with "require" and understood by webpack: three three-orbit-controls This is how I use it: var THREE = require('three'); var OrbitControls = require('three-orbit-controls')(THREE); To…
Denis
  • 167
  • 3
  • 20
2
votes
1 answer

ThreeJS with PhysiJS physics engine not triggering collision event

Expected outcome: a box will drop on the ground and it will produce an alert box saying "Box just hit the ground" What's happening: alert box is not being created. Relevant javascript console logs are also not being produced upon collision. I am…
Rakib
  • 12,376
  • 16
  • 77
  • 113
2
votes
1 answer

Physijs simple collision between meshes without gravity

i am using Physijs to determine static collision between my meshes. As i need to know what surfaces are intersecting. i hacked a simple demo that seems to work. currently i have to configure my scene to use gravity, which prevents me from position…
lpic
  • 560
  • 1
  • 7
  • 20
2
votes
1 answer

After setting vertices on THREE.Geometry objects, THREE.Shape.Utils.triangulateShape fails with TypeError

I've created a game made from THREE.JS and Physijs. I made a function called addBlock2 that adds a triangular pyramid to the scene. It sets the appropriate vertices, but when it comes to triangulateShape it fails with the following error: Uncaught…
2
votes
1 answer

PhysiJS do not work on localhost (works fine on online examples)

As can be seen in the title, when I run the example of physiJS (from github repo) it show only background, fps counter, but no physiJS functionality at all (pure three.js works fine). When I run on the:…
2
votes
2 answers

Three.JS FPS Controls Strafing Left and Right

I am setting up a simple demo to test player controls for a FPS. I have the mouse rotating the camera and the player can move with W-A-S-D. My question is what is the algorithm I need for the player to be able to move left and right relative to the…
snowcap420
  • 91
  • 1
  • 11
2
votes
1 answer

Physijs - ConvexMesh wall collision detection issue

I'm using Three.js and Physijs. I have a wall that should act as a boundary, but objects (especially boxes) often pass through it, if the force is sufficient. The collision is detected, as they do not do so cleanly, but they start spinning or bounce…
user2623008
  • 311
  • 3
  • 13
1
2 3 4 5