@Override public void applyForce(org.terasology.math.geom.Vector3f force) { pendingForce.add(VecMath.to(force)); }
@Override public void applyImpulse(org.terasology.math.geom.Vector3f impulse) { pendingImpulse.add(VecMath.to(impulse)); }
Vector3f from = VecMath.to(from1); to.scale(distance); to.add(from);
@Override public void awakenArea(org.terasology.math.geom.Vector3f pos, float radius) { Vector3f min = new Vector3f(VecMath.to(pos)); min.sub(new Vector3f(0.6f, 0.6f, 0.6f)); Vector3f max = new Vector3f(VecMath.to(pos)); max.add(new Vector3f(0.6f, 0.6f, 0.6f)); discreteDynamicsWorld.awakenRigidBodiesInArea(min, max); }
Vector3f fromWorld = new Vector3f(hitPointWorld); fromWorld.y += stepHeight + 0.05f; fromWorld.add(lookAheadOffset); Vector3f toWorld = new Vector3f(hitPointWorld); toWorld.y -= 0.05f; toWorld.add(lookAheadOffset); CollisionWorld.ClosestRayResultCallback rayResult = new CollisionWorld.ClosestRayResultCallback(fromWorld, toWorld); Transform transformFrom = new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), fromWorld, 1.0f)); stepSlope = rayResult.hitNormalWorld.dot(new Vector3f(0, 1, 0)); fromWorld.add(lookAheadOffset); toWorld.add(lookAheadOffset); rayResult = new CollisionWorld.ClosestRayResultCallback(fromWorld, toWorld); transformFrom = new Transform(new Matrix4f(new Quat4f(0, 0, 0, 1), fromWorld, 1.0f));
public void incrementDisp(double x, double y, double z) { disp.add(new Vector3f((float)x, (float)y, (float)z)); // disp.set(1, disp.get(1) + y); }
vertexNormal.add(normalsPerFace[face]);
/** * @param touchPoint * @param screenWidth * @param screenHeight * @param projectionMatrix * @param viewMatrix * @return */ public static Vector3f GetWorldCoords(Vector2f touchPoint, float screenWidth, float screenHeight, float[] projectionMatrix, float[] viewMatrix) { Ray touchRay = projectRay(touchPoint, screenWidth, screenHeight, projectionMatrix, viewMatrix); touchRay.direction.scale(AppSettings.getStrokeDrawDistance()); touchRay.origin.add(touchRay.direction); return touchRay.origin; }
public void move (Vector3D move) { Transform3D t = getTransform(); Vector3f r = new Vector3f(); t.get(r); r.add(createVector3f(move)); t.setTranslation(r); setTransform(t); }
public void move (Vector3D move) { Transform3D t = getTransform(); Vector3f r = new Vector3f(); t.get(r); r.add(createVector3f(move)); t.setTranslation(r); setTransform(t); }
normalesp[_indices[i * 3 + j]].add(new Vector3f(normales[i])); nbNormales[_indices[i * 3 + j]]++;