@Override protected Vector3 newObject () { return new Vector3(); } };
@Override protected Vector3 newObject () { return new Vector3(); } };
/** Constructs a sphere with the given center and radius * @param center The center * @param radius The radius */ public Sphere (Vector3 center, float radius) { this.center = new Vector3(center); this.radius = radius; }
/** Constructs a sphere with the given center and radius * @param center The center * @param radius The radius */ public Sphere (Vector3 center, float radius) { this.center = new Vector3(center); this.radius = radius; }
@Override protected Vector3 newObject () { return new Vector3(); } };
@Override public Vector3 cpy () { return new Vector3(this); }
public Frustum () { for (int i = 0; i < 6; i++) { planes[i] = new Plane(new Vector3(), 0); } }
public Frustum () { for (int i = 0; i < 6; i++) { planes[i] = new Plane(new Vector3(), 0); } }
@Override public BulletWorld createWorld () { // We create the world using an axis sweep broadphase for this test btDefaultCollisionConfiguration collisionConfiguration = new btDefaultCollisionConfiguration(); btCollisionDispatcher dispatcher = new btCollisionDispatcher(collisionConfiguration); btAxisSweep3 sweep = new btAxisSweep3(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)); btSequentialImpulseConstraintSolver solver = new btSequentialImpulseConstraintSolver(); btDiscreteDynamicsWorld collisionWorld = new btDiscreteDynamicsWorld(dispatcher, sweep, solver, collisionConfiguration); ghostPairCallback = new btGhostPairCallback(); sweep.getOverlappingPairCache().setInternalGhostPairCallback(ghostPairCallback); return new BulletWorld(collisionConfiguration, dispatcher, sweep, solver, collisionWorld); }
public ParticleController () { transform = new Matrix4(); scale = new Vector3(1, 1, 1); influencers = new Array<Influencer>(true, 3, Influencer.class); setTimeStep(DEFAULT_TIME_STEP); }
public boolean touchDown (int x, int y, int pointer, int newParam) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public ParticleController () { transform = new Matrix4(); scale = new Vector3(1, 1, 1); influencers = new Array<Influencer>(true, 3, Influencer.class); setTimeStep(DEFAULT_TIME_STEP); }
public boolean touchDown (int x, int y, int pointer, int newParam) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public boolean touchDragged (int x, int y, int pointer) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
public boolean touchDragged (int x, int y, int pointer) { if (Gdx.input.isButtonPressed(Input.Buttons.RIGHT)) { Vector3 touchPoint = new Vector3(x, y, 0); worldCamera.unproject(touchPoint); effect.setPosition(touchPoint.x, touchPoint.y); } return false; }
@Test public void testBoundingBox () { BoundingBox b1 = new BoundingBox(Vector3.Zero, new Vector3(1, 1, 1)); BoundingBox b2 = new BoundingBox(new Vector3(1, 1, 1), new Vector3(2, 2, 2)); assertTrue(b1.contains(Vector3.Zero)); assertTrue(b1.contains(b1)); assertFalse(b1.contains(b2)); // Note, in stage the bottom and left sides are inclusive while the right and top sides are exclusive. }
@Test public void testToString () { assertEquals("(-5.0,42.00055,44444.32)", new Vector3(-5f, 42.00055f, 44444.32f).toString()); }