protected void SetupModel(Vector3 position)
{
//set scale
scale = 1.0f;
//save bones
if (model != null)
{
boneTransforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(boneTransforms);
}
//setup transforms
transforms = Matrix.CreateScale(scale) * Matrix.CreateTranslation(position);
//give default rotation
rotationMatrixX = Matrix.CreateRotationX(0.0f);
rotationMatrixY = Matrix.CreateRotationY(0.0f);
rotationMatrixZ = Matrix.CreateRotationZ(0.0f);
//give default position
this.Position = position;
}