///<summary> /// Constructs a new Terrain. ///</summary> ///<param name="shape">Shape to use for the terrain.</param> ///<param name="worldTransform">Transform to use for the terrain.</param> public Terrain(TerrainShape shape, AffineTransform worldTransform) { WorldTransform = worldTransform; Shape = shape; Events = new ContactEventManager<Terrain>(); }
///<summary> /// Constructs a new Terrain. ///</summary> ///<param name="shape">Shape to use for the terrain.</param> ///<param name="worldTransform">Transform to use for the terrain.</param> public Terrain(TerrainShape shape, AffineTransform worldTransform) { WorldTransform = worldTransform; Shape = shape; Events = new ContactEventManager <Terrain>(); }
///<summary> /// Constructs a new InstancedMesh. ///</summary> ///<param name="meshShape">Shape to use for the instance.</param> ///<param name="worldTransform">Transform to use for the instance.</param> public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform) { this.worldTransform = worldTransform; base.Shape = meshShape; Events = new ContactEventManager<InstancedMesh>(); }
public MobileChunkCollidable(MobileChunkShape shape) { ChunkShape = shape; base.Shape = ChunkShape; Vector3 max = new Vector3(shape.ChunkSize.X, shape.ChunkSize.Y, shape.ChunkSize.Z); boundingBox = new BoundingBox(-max, max); Events = new ContactEventManager<EntityCollidable>(); LocalPosition = -shape.Center; }
public FullChunkObject(Vector3 pos, BlockInternal[] blocks) { ChunkShape = new FullChunkShape(blocks); base.Shape = ChunkShape; Position = pos; boundingBox = new BoundingBox(Position, Position + new Vector3(30, 30, 30)); Events = new ContactEventManager <FullChunkObject>(this); Material.Bounciness = 0.75f; }
public FullChunkObject(Vector3 pos, BlockInternal[] blocks) { ChunkShape = new FullChunkShape(blocks); base.Shape = ChunkShape; Position = pos; boundingBox = new BoundingBox(Position, Position + new Vector3(30, 30, 30)); Events = new ContactEventManager<FullChunkObject>(this); Material.Bounciness = 0.75f; }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> public StaticMesh(Vector3[] vertices, int[] indices) { base.Shape = new StaticMeshShape(vertices, indices); collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; events = new ContactEventManager<StaticMesh>(this); material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; }
public MobileChunkCollidable(MobileChunkShape shape) { ChunkShape = shape; base.Shape = ChunkShape; Vector3 max = new Vector3(shape.ChunkSize.X, shape.ChunkSize.Y, shape.ChunkSize.Z); boundingBox = new BoundingBox(-max, max); Events = new ContactEventManager <EntityCollidable>(); LocalPosition = -shape.Center; }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> /// <param name="worldTransform">Transform to use to create the mesh initially.</param> public StaticMesh(Vector3[] vertices, int[] indices, AffineTransform worldTransform) { base.Shape = new StaticMeshShape(vertices, indices, worldTransform); collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; events = new ContactEventManager <StaticMesh>(this); material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="globalMove"></param> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> /// <param name="worldTransform">Transform to use to create the mesh initially.</param> public StaticMesh(Vector3 globalMove, List <VertexCubeSolid> vertices, List <ushort> indices, AffineTransform worldTransform) { base.Shape = new StaticMeshShape(globalMove, vertices, indices, worldTransform); collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; events = new ContactEventManager <StaticMesh>(this); material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; }
///<summary> /// Constructs a new InstancedMesh. ///</summary> ///<param name="meshShape">Shape to use for the instance.</param> ///<param name="worldTransform">Transform to use for the instance.</param> public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform) { this.worldTransform = worldTransform; base.Shape = meshShape; collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; events = new ContactEventManager <InstancedMesh>(this); material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; }
///<summary> /// Constructs a new Terrain. ///</summary> ///<param name="shape">Shape to use for the terrain.</param> ///<param name="worldTransform">Transform to use for the terrain.</param> public Terrain(TerrainShape shape, AffineTransform worldTransform) { this.worldTransform = worldTransform; Shape = shape; collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; events = new ContactEventManager <Terrain>(this); }
///<summary> /// Constructs a new InstancedMesh. ///</summary> ///<param name="meshShape">Shape to use for the instance.</param> ///<param name="worldTransform">Transform to use for the instance.</param> public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform) { this.worldTransform = worldTransform; base.Shape = meshShape; collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; events = new ContactEventManager<InstancedMesh>(this); material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; }
protected EntityCollidable() { //This constructor is used when the subclass is going to set the shape after doing some extra initialization. Events = new ContactEventManager <EntityCollidable>(this); }
///<summary> /// Constructs a new InstancedMesh. ///</summary> ///<param name="meshShape">Shape to use for the instance.</param> ///<param name="worldTransform">Transform to use for the instance.</param> public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform) { this.worldTransform = worldTransform; base.Shape = meshShape; Events = new ContactEventManager <InstancedMesh>(); }
protected ConvexCollidable(ConvexShape shape) : base(shape) { Events = new ContactEventManager<EntityCollidable>(); }
/// <summary> /// Constructs a new mobile mesh collidable. /// </summary> /// <param name="shape">Shape to use in the collidable.</param> public MobileMeshCollidable(MobileMeshShape shape) : base(shape) { Events = new ContactEventManager<EntityCollidable>(); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> /// <param name="worldTransform">Transform to use to create the mesh initially.</param> public StaticMesh(Vector3[] vertices, int[] indices, AffineTransform worldTransform) { base.Shape = new StaticMeshShape(vertices, indices, worldTransform); Events = new ContactEventManager <StaticMesh>(); }
public VoxelGrid(VoxelGridShape shape, Vector3 position) { Position = position; base.Shape = shape; events = new ContactEventManager <VoxelGrid>(this); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="collidables">List of collidables in the static group.</param> public StaticGroup(IList<Collidable> collidables) { shape = new StaticGroupShape(collidables, this); Events = new ContactEventManager<StaticGroup>(); }
///<summary> /// Constructs a new Terrain. ///</summary> ///<param name="shape">Shape to use for the terrain.</param> ///<param name="worldTransform">Transform to use for the terrain.</param> public Terrain(TerrainShape shape, AffineTransform worldTransform) { this.worldTransform = worldTransform; Shape = shape; collisionRules.group = CollisionRules.DefaultKinematicCollisionGroup; material = new Material(); materialChangedDelegate = OnMaterialChanged; material.MaterialChanged += materialChangedDelegate; events = new ContactEventManager<Terrain>(this); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> public StaticMesh(Vector3[] vertices, int[] indices) { base.Shape = new StaticMeshShape(vertices, indices); Events = new ContactEventManager <StaticMesh>(); }
protected EntityCollidable() { //This constructor is used when the subclass is going to set the shape after doing some extra initialization. Events = new ContactEventManager<EntityCollidable>(this); }
protected ConvexCollidable(ConvexShape shape) : base(shape) { Events = new ContactEventManager <EntityCollidable>(); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> public StaticMesh(Vector3[] vertices, int[] indices) { base.Shape = new StaticMeshShape(vertices, indices); Events = new ContactEventManager<StaticMesh>(); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="collidables">List of collidables in the static group.</param> public StaticGroup(IList <Collidable> collidables) { base.Shape = new StaticGroupShape(collidables, this); Events = new ContactEventManager <StaticGroup>(); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> /// <param name="worldTransform">Transform to use to create the mesh initially.</param> public StaticMesh(Vector3[] vertices, int[] indices, AffineTransform worldTransform) { base.Shape = new StaticMeshShape(vertices, indices, worldTransform); Events = new ContactEventManager<StaticMesh>(); }
/// <summary> /// Constructs a new mobile mesh collidable. /// </summary> /// <param name="shape">Shape to use in the collidable.</param> public MobileMeshCollidable(MobileMeshShape shape) : base(shape) { Events = new ContactEventManager <EntityCollidable>(); }
public VoxelBlob( VoxelBlobShape shape, Vector3 position ) { Position = position; base.Shape = shape; events = new ContactEventManager<VoxelBlob>( this ); }