Relations between x y axis and the velocity in pixels? #1093
-
Hi: We tried to compare the two velocities and find the relationship between x, y coordinates and the velocity in pixels var velocity = 6;
physics.setVelocityX(FXGL.getPhysicsWorld().toPixels(velocity); the 2nd is var velocity = 6;
entity.setX(entity.getX + velocity); in theory they should be equal right? jboxWorld.setParticleDensity(1.2f); so any idea why this happened? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are two methods in PhysicsComponent that take velocity: one is in pixels, the other in meters. Velocity is measured by units per second, rather than units per frame (at least as far as I can remember), so something like |
Beta Was this translation helpful? Give feedback.
There are two methods in PhysicsComponent that take velocity: one is in pixels, the other in meters. Velocity is measured by units per second, rather than units per frame (at least as far as I can remember), so something like
x += velocity * tpf
is a closer comparison.