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
1
vote
1 answer

How to turn off Physijs to improve performance on mobile devices?

I'm trying to find a way to improve performance of my card game on mobile devices (wrapped with Cordova). The script detect if WebGL is available and fallback to Canvas 2d if it's not supported. But I get a low 5-10fps on my Samsung Galaxy S4. Is it…
Jeremy Dicaire
  • 4,615
  • 8
  • 38
  • 62
1
vote
1 answer

How to get Physijs and Threejs to work together with tQuery

Good evening, I recently switched from EaselJS to Threejs, it's amazing! I've tried to include a physic engine called Physijs and use it with tQuery with this tutorial but it's not working. Head:
Jeremy Dicaire
  • 4,615
  • 8
  • 38
  • 62
1
vote
1 answer

Threejs/Physijs Game MMO Character controlls

I'm working on a third person character control for a game i'm developing. I'm happy with the results so far. The character controls have a lot of neat features like: if an object is in front of the camera it will move forward so you can still see…
Nick Hecht
  • 131
  • 1
  • 2
  • 10
1
vote
1 answer

How to draw the trajectory of a mesh with threejs

I'm trying to draw the trajectory of a projectile motion with threejs. Which is the best way to do that? Here is an example of it: http://www.physgl.org/index.php/welcome/logout Try the projectile motion demo and click run. I thought of drawing a…
juanpscotto
  • 990
  • 1
  • 13
  • 32
1
vote
1 answer

Player movement/physics with Physi.js

I'm creating a simple game using Three.js as the renderer and Physijs for the physics engine, although this question can easily be generalized to games as a whole. In games, the player often has physics/movement that seems separate from the physics…
Will
  • 1,621
  • 15
  • 20
1
vote
1 answer

PhysiJS: How to get linear velocity at a given point on a rotating object

How can I query the linear velocity (relative to world space) of a point of an object in PhysiJS, given the object's linear and angular velocity? I was thinking of creating an invisible vertex on the object for this purpose, but I don't think the…
Jodes
  • 14,118
  • 26
  • 97
  • 156
0
votes
0 answers

Setting "this" in a class constructor

Similar to how you can call __init__ on anything in python class Class(): def __init__(self, a): self["a"] = a dic = { "a": 0 } # create dict Class.__init__(dic, 5); # "init" the dict print(dic) # value "a" changes How would you call…
SollyBunny
  • 800
  • 1
  • 8
  • 15
0
votes
1 answer

Uncaught TypeError:Class constructor Scene cannot be invoked without 'new' line:391 of:file:///storage/emulated/0/threejs/libs/physi.js

I have been using Physijs with the older version of three.js and it works perfectly But when I downloaded the latest version of threejs it doesn't work even to just put a plane mesh on the scene It brings out this error Uncaught TypeError: Class…
Icekid
  • 435
  • 3
  • 14
0
votes
1 answer

Trouble adding Physijs.Vehicle to Scene

Error adding a Physijs.Vehicle to a Physijs.Scene THREE.Object3D.add: object not an instance of THREE.Object3D Have tried going through the vehicle example on the Physijs page, but the same steps do not work. Relevant code from the example…
bwsmith
  • 165
  • 2
  • 4
  • 11
0
votes
0 answers

Javascript addEventListener isn't allowing more than one mouse event

I am trying to add multiple event listeners listening for mouse events to a single element, but only one event is ever activating. When I have a 'drag' event listener and a 'mouseup' event listener, only the drag event executes, and when I change…
Josiah Plett
  • 180
  • 14
0
votes
1 answer

404 Error with PhysiJS in Angular

I am trying to get Physijs running with Angular. The Three Scene is working fine so far but I dont get any Physics effects. I installed the following with npm: https://www.npmjs.com/package/physijs-browserify My corresponding Component.ts part for…
aloner92
  • 5
  • 1
0
votes
1 answer

Error in loading physi.js and ammo.js

I'm trying to develop a project with physijs. I have encountered this type of error (from mozilla firefox console): NetworkError: Failed to load worker script at "js/libs/ammo.js" I'm trying to fix it but with no results. This is my code snippet…
Gil
  • 111
  • 1
  • 7
0
votes
1 answer

ThreeJS & PhysiJS not triggering collision event

I have an issue while using PhysiJS and Three JS, I can't handle collision event. Repository on Github : https://github.com/kevrmnd/soccer-physics (in script.js file) I have a ground and a ball, I put an eventlistener on the ball which should alert…
bookah
  • 1
0
votes
1 answer

Turning objects so they reset their y-rotation in Three.js

Using three.js, I'm creating a game with cars that move in a specific direction, depending on their y-rotation. An example would be 90 degrees. I use object.translateZ() to move them forward but I've run into a problem. I'm using physijs to simulate…
Griffin M.
  • 196
  • 1
  • 17
0
votes
1 answer

Rotation When Object is Spinning

[] [] Imagine those are the front tires of a car and they're spinning forward in a straight line. How would I rotate them (in a steering motion) without them being affected by their local (spinning) rotation?
M1ke
  • 239
  • 2
  • 11