Esempio n. 1
0
 public PhysicsComponent(bool movable, bool simulated, PhysicsMeshType type)
 {
     this.PhysicsMeshType = type;
     Enabled      = true;
     Simulated    = simulated;
     this.movable = movable;
 }
Esempio n. 2
0
 private static extern void Internal_create(PhysicsMesh managedInstance, MeshData meshData, PhysicsMeshType type);
Esempio n. 3
0
 /// <summary>Creates a new physics mesh.</summary>
 /// <param name="meshData">Index and vertices of the mesh data.</param>
 /// <param name="type">
 /// Type of the mesh. If convex the provided mesh geometry will be converted into a convex mesh (that might not be the
 /// same as the provided mesh data).
 /// </param>
 public PhysicsMesh(MeshData meshData, PhysicsMeshType type = PhysicsMeshType.Convex)
 {
     Internal_create(this, meshData, type);
 }
Esempio n. 4
0
        /// <summary>
        /// Fully simulated physics object.
        /// </summary>
        /// <param name="shape"></param>
        /// <param name="effect"></param>
        /// <param name="meshType"></param>
        /// <returns></returns>
        public static GameObject CreateSimulatedObject(ProceduralShape shape, Effect effect, PhysicsMeshType meshType)
        {
            var ob = CreateRenderableGameObjectFromShape(shape, effect);

            ob.AddComponent(new PhysicsComponent(true, true, meshType));
            return(ob);
        }