public PhysicsComponent(bool movable, bool simulated, PhysicsMeshType type) { this.PhysicsMeshType = type; Enabled = true; Simulated = simulated; this.movable = movable; }
private static extern void Internal_create(PhysicsMesh managedInstance, MeshData meshData, PhysicsMeshType type);
/// <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); }
/// <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); }