Esempio n. 1
0
        ///<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>();
        }
Esempio n. 2
0
        ///<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>();
        }
Esempio n. 3
0
        ///<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>();


        }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 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;
 }
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
        ///<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;
        }
Esempio n. 8
0
        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;
        }
Esempio n. 9
0
        ///<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;
        }
Esempio n. 10
0
        ///<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;
        }
Esempio n. 11
0
        ///<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;
        }
Esempio n. 12
0
        ///<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);
        }
Esempio n. 13
0
        ///<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;

        }
Esempio n. 14
0
 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);
 }
Esempio n. 15
0
 ///<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>();
 }
Esempio n. 16
0
 protected ConvexCollidable(ConvexShape shape)
     : base(shape)
 {
     Events = new ContactEventManager<EntityCollidable>();
 }
Esempio n. 17
0
 /// <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>();
 }
Esempio n. 18
0
 ///<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>();
 }
Esempio n. 21
0
        ///<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);
        }
Esempio n. 22
0
 ///<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>();
 }
Esempio n. 23
0
 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);
 }
Esempio n. 24
0
 protected ConvexCollidable(ConvexShape shape)
     : base(shape)
 {
     Events = new ContactEventManager <EntityCollidable>();
 }
Esempio n. 25
0
 ///<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>();
 }
Esempio n. 26
0
 ///<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>();
 }
Esempio n. 27
0
 ///<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>();
 }
Esempio n. 28
0
 /// <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>();
 }
Esempio n. 29
0
		public VoxelBlob( VoxelBlobShape shape, Vector3 position )
		{
			Position = position;
			base.Shape = shape;
			events = new ContactEventManager<VoxelBlob>( this );
		}