コード例 #1
0
ファイル: Terrain.cs プロジェクト: Raverenx/GameEngine
        ///<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>();
        }
コード例 #2
0
ファイル: Terrain.cs プロジェクト: AlienEngine/AlienEngine
        ///<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>();
        }
コード例 #3
0
ファイル: InstancedMesh.cs プロジェクト: d3x0r/Voxelarium
        ///<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>();


        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #6
0
ファイル: FullChunkObject.cs プロジェクト: Morphan1/Voxalia
 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;
 }
コード例 #7
0
ファイル: StaticMesh.cs プロジェクト: VICOGameStudio-Ujen/igf
        ///<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;
        }
コード例 #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;
        }
コード例 #9
0
ファイル: StaticMesh.cs プロジェクト: ErtyHackward/utopia
        ///<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;
        }
コード例 #10
0
ファイル: StaticMesh.cs プロジェクト: ErtyHackward/utopia
        ///<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;
        }
コード例 #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;
        }
コード例 #12
0
ファイル: Terrain.cs プロジェクト: ErtyHackward/utopia
        ///<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);
        }
コード例 #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;

        }
コード例 #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);
 }
コード例 #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>();
 }
コード例 #16
0
ファイル: ConvexCollidable.cs プロジェクト: dcsan/Lemma
 protected ConvexCollidable(ConvexShape shape)
     : base(shape)
 {
     Events = new ContactEventManager<EntityCollidable>();
 }
コード例 #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>();
 }
コード例 #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>();
 }
コード例 #19
0
 public VoxelGrid(VoxelGridShape shape, Vector3 position)
 {
     Position   = position;
     base.Shape = shape;
     events     = new ContactEventManager <VoxelGrid>(this);
 }
コード例 #20
0
 ///<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>();
 }
コード例 #21
0
ファイル: Terrain.cs プロジェクト: VICOGameStudio-Ujen/igf
        ///<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);
        }
コード例 #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>();
 }
コード例 #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);
 }
コード例 #24
0
 protected ConvexCollidable(ConvexShape shape)
     : base(shape)
 {
     Events = new ContactEventManager <EntityCollidable>();
 }
コード例 #25
0
ファイル: StaticMesh.cs プロジェクト: Telanor/bepu-fork
 ///<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>();
 }
コード例 #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>();
 }
コード例 #27
0
ファイル: StaticMesh.cs プロジェクト: Telanor/bepu-fork
 ///<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>();
 }
コード例 #28
0
ファイル: MobileMeshCollidable.cs プロジェクト: ByteChkR/Byt3
 /// <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>();
 }
コード例 #29
0
ファイル: BEPU.VoxelBlob.cs プロジェクト: d3x0r/Voxelarium
		public VoxelBlob( VoxelBlobShape shape, Vector3 position )
		{
			Position = position;
			base.Shape = shape;
			events = new ContactEventManager<VoxelBlob>( this );
		}