}
public void shootBox(Vector3f destination) {
if (dynamicsWorld != null) {
float mass = 10f;
Transform startTransform = new Transform();
startTransform.setIdentity();
Vector3f camPos = new Vector3f(getCameraPosition());
startTransform.origin.set(camPos);
if (shootBoxShape == null) {
//#define TEST_UNIFORM_SCALING_SHAPE 1
//#ifdef TEST_UNIFORM_SCALING_SHAPE
//btConvexShape* childShape = new btBoxShape(btVector3(1.f,1.f,1.f));
//m_shootBoxShape = new btUniformScalingShape(childShape,0.5f);
//#else
shootBoxShape = new BoxShape(new Vector3f(1f, 1f, 1f));
//#endif//
}
RigidBody body = this.localCreateRigidBody(mass, startTransform, shootBoxShape);
Vector3f linVel = new Vector3f(destination.x - camPos.x, destination.y - camPos.y, destination.z - camPos.z);
linVel.normalize();
linVel.scale(ShootBoxInitialSpeed);
Transform worldTrans = body.getWorldTransform(new Transform());
worldTrans.origin.set(camPos);
worldTrans.setRotation(new Quat4f(0f, 0f, 0f, 1f));
body.setWorldTransform(worldTrans);
body.setLinearVelocity(linVel);
body.setAngularVelocity(new Vector3f(0f, 0f, 0f));