private boolean intersectsWith(BoundingSphere bsphere) { return Intersector.intersectRaySphere(mRayStart, mRayEnd, bsphere.getPosition(), bsphere.getRadius(), mHitPoint); }
public boolean intersectsWith(IBoundingVolume boundingVolume) { if(!(boundingVolume instanceof BoundingSphere)) return false; BoundingSphere boundingSphere = (BoundingSphere)boundingVolume; mTmpPos.setAll(mPosition); mTmpPos.subtract(boundingSphere.getPosition()); mDist = mTmpPos.x * mTmpPos.x + mTmpPos.y * mTmpPos.y + mTmpPos.z * mTmpPos.z; mMinDist = mRadius * mScale + boundingSphere.getRadius() * boundingSphere.getScale(); return mDist < mMinDist * mMinDist; }
} else if (volume instanceof BoundingSphere) { BoundingSphere bs = (BoundingSphere) volume; Vector3 bs_position = bs.getPosition(); double radius = bs.getScaledRadius(); Vector3 rad = new Vector3();
@Test public void testGetPosition() { Vector3 position = bounds.getPosition(); assertEquals(0, position.x, 1e-14); assertEquals(0, position.y, 1e-14); assertEquals(0, position.z, 1e-14); }
private boolean intersectsWith(BoundingSphere bsphere) { return Intersector.intersectRaySphere(mRayStart, mRayEnd, bsphere.getPosition(), bsphere.getRadius(), mHitPoint); }
public boolean intersectsWith(IBoundingVolume boundingVolume) { if (!(boundingVolume instanceof BoundingSphere)) return false; BoundingSphere boundingSphere = (BoundingSphere) boundingVolume; mTmpPos.setAll(mPosition); mTmpPos.subtract(boundingSphere.getPosition()); mDist = mTmpPos.x * mTmpPos.x + mTmpPos.y * mTmpPos.y + mTmpPos.z * mTmpPos.z; mMinDist = mRadius * mScale + boundingSphere.getRadius() * boundingSphere.getScale(); return mDist < mMinDist * mMinDist; }
} else if (volume instanceof BoundingSphere) { BoundingSphere bs = (BoundingSphere) volume; Vector3 bs_position = bs.getPosition(); double radius = bs.getScaledRadius(); Vector3 rad = new Vector3();