Example #1
0
        protected override void CreateScene()
        {
            RenderManager.BackgroundColor = Color.CornflowerBlue;

            // Main Camera definition and Pick Entity Behavior
            FreeCamera camera = new FreeCamera("MainCamera", new Vector3(0, 40, 50), Vector3.Zero);

            camera.Entity.AddComponent(new PickingBehavior());
            this.EntityManager.Add(camera.Entity);

            // Sample needs Collision groups to ignore collisions between wheels and body
            // Collision group 1: Body
            // Collision group 2: Wheels (ignores collision with body)
            // collision group 3: terrain (collides with body and wheels)
            Physic3DCollisionGroup bodyCollisiongroup = new Physic3DCollisionGroup();

            Physic3DCollisionGroup wheelCollistionGroup = new Physic3DCollisionGroup();

            wheelCollistionGroup.IgnoreCollisionWith(bodyCollisiongroup);

            Physic3DCollisionGroup terrainCollisiongroup = new Physic3DCollisionGroup();

            terrainCollisiongroup.DefineCollisionWith(bodyCollisiongroup);
            terrainCollisiongroup.DefineCollisionWith(wheelCollistionGroup);

            // Creates Entities
            this.CreateGround(new Vector3(0, -5, 0), terrainCollisiongroup);
            this.CreateVehicle(bodyCollisiongroup, wheelCollistionGroup);
        }
Example #2
0
        protected override void CreateScene()
        {
            RenderManager.BackgroundColor = Color.CornflowerBlue;

            // Main Camera definition and Pick Entity Behavior
            FreeCamera camera = new FreeCamera("MainCamera", new Vector3(0, 40, 50), Vector3.Zero);
            camera.Entity.AddComponent(new PickingBehavior());
            this.EntityManager.Add(camera.Entity);

            // Sample needs Collision groups to ignore collisions between wheels and body
            // Collision group 1: Body
            // Collision group 2: Wheels (ignores collision with body)
            // collision group 3: terrain (collides with body and wheels)
            Physic3DCollisionGroup bodyCollisiongroup = new Physic3DCollisionGroup();

            Physic3DCollisionGroup wheelCollistionGroup = new Physic3DCollisionGroup();
            wheelCollistionGroup.IgnoreCollisionWith(bodyCollisiongroup);

            Physic3DCollisionGroup terrainCollisiongroup = new Physic3DCollisionGroup();
            terrainCollisiongroup.DefineCollisionWith(bodyCollisiongroup);
            terrainCollisiongroup.DefineCollisionWith(wheelCollistionGroup);

            // Creates Entities
            this.CreateGround(new Vector3(0, -5, 0), terrainCollisiongroup);
            this.CreateVehicle(bodyCollisiongroup, wheelCollistionGroup);
        }
Example #3
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

            var groupA = new Physic3DCollisionGroup();
            var groupB = new Physic3DCollisionGroup();

            // GroupA RED will Ignore Self Group Collision
            groupA.IgnoreCollisionWith(groupA);

            // GroupA RED will Ignore GroupB BLUE Collision
            groupA.IgnoreCollisionWith(groupB);

            // Creates Red-Red enviroment
            this.AddEntityToCollisionGroup("sphereA01", groupA);
            this.AddEntityToCollisionGroup("sphereA02", groupA);
            // Creates Blue-Red enviroment
            this.AddEntityToCollisionGroup("sphereA03", groupA);
            this.AddEntityToCollisionGroup("sphereB01", groupB);
            // Creates Blue-Blue enviroment
            this.AddEntityToCollisionGroup("sphereB02", groupB);
            this.AddEntityToCollisionGroup("sphereB03", groupB);
        }
Example #4
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

            var groupA = new Physic3DCollisionGroup();
            var groupB = new Physic3DCollisionGroup();

            // GroupA RED will Ignore Self Group Collision
            groupA.IgnoreCollisionWith(groupA);

            // GroupA RED will Ignore GroupB BLUE Collision
            groupA.IgnoreCollisionWith(groupB);

            // Creates Red-Red enviroment
            this.AddEntityToCollisionGroup("sphereA01", groupA);
            this.AddEntityToCollisionGroup("sphereA02", groupA);
            // Creates Blue-Red enviroment
            this.AddEntityToCollisionGroup("sphereA03", groupA);
            this.AddEntityToCollisionGroup("sphereB01", groupB);
            // Creates Blue-Blue enviroment
            this.AddEntityToCollisionGroup("sphereB02", groupB);
            this.AddEntityToCollisionGroup("sphereB03", groupB);
        }
Example #5
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

            // This sample needs Collision Groups to ignore such between chasis and wheels
            var chasisCollisionGroup = new Physic3DCollisionGroup();

            var wheelCollisionGroup = new Physic3DCollisionGroup();
            wheelCollisionGroup.IgnoreCollisionWith(chasisCollisionGroup);

            var groundCollisionGroup = new Physic3DCollisionGroup();
            groundCollisionGroup.DefineCollisionWith(chasisCollisionGroup);
            groundCollisionGroup.DefineCollisionWith(wheelCollisionGroup);

            this.SetUpPhysicsOnGround(chasisCollisionGroup);
            this.SetUpPhysicsOnWheels(wheelCollisionGroup);
            this.SetUpPhysicsOnChasis(groundCollisionGroup);
        }
Example #6
0
        protected override void CreateScene()
        {
            this.Load(WaveContent.Scenes.MyScene);

            // This sample needs Collision Groups to ignore such between chasis and wheels
            var chasisCollisionGroup = new Physic3DCollisionGroup();

            var wheelCollisionGroup = new Physic3DCollisionGroup();

            wheelCollisionGroup.IgnoreCollisionWith(chasisCollisionGroup);

            var groundCollisionGroup = new Physic3DCollisionGroup();

            groundCollisionGroup.DefineCollisionWith(chasisCollisionGroup);
            groundCollisionGroup.DefineCollisionWith(wheelCollisionGroup);

            this.SetUpPhysicsOnGround(chasisCollisionGroup);
            this.SetUpPhysicsOnWheels(wheelCollisionGroup);
            this.SetUpPhysicsOnChasis(groundCollisionGroup);
        }