Esempio n. 1
0
 /// <summary>
 /// Create a new Object3D, place it on the stage, add to Model3D's instance collection, 
 /// and if collidable add to collision collection. 
 /// </summary>
 /// <param name="position"> location of new Object3D</param>
 /// <param name="orientAxis"> axis of rotation</param>
 /// <param name="radians"> rotation on orientAxis</param>
 /// <returns> the new Object3D</returns>
 public Object3D addObject(Vector3 position, Vector3 orientAxis, float radians)
 {
     Object3D obj3d = new Object3D(stage, this, String.Format("{0}.{1}", name, instance.Count),
      position, orientAxis, radians, Vector3.One);
     obj3d.updateBoundingSphere();  // need to do only once for Model3D
       instance.Add(obj3d);
       if (IsCollidable) stage.Collidable.Add(obj3d);
       return obj3d;
 }