Esempio n. 1
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            collisionListener            = AddComponent <CollisionListener>();
            collisionListener.OnCollide += CollisionListener_OnCollide;

            NativeEntity.LoadGeometry(0, "objects/default/primitive_sphere.cgf");

            var physParams = new SEntityPhysicalizeParams()
            {
                density = 1,
                mass    = 10,
                type    = (int)EPhysicalizationType.ePT_Rigid,
            };

            NativeEntity.Physicalize(physParams);
        }
Esempio n. 2
0
        public override void OnInitialize()
        {
            var physParams = new SEntityPhysicalizeParams()
            {
                mass    = -1,
                density = -1,
                type    = (int)EPhysicalizationType.ePT_Rigid,
            };

            // Create the mesh that responds to mouse interaction
            NativeEntity.LoadGeometry(slotInteractionPlate, AssetLibrary.Meshes.Hexagon);
            NativeEntity.SetSlotMaterial(slotInteractionPlate, AssetLibrary.Materials.GreyMin);

            // Create the BasePlate that represents the Construction Point.
            NativeEntity.LoadGeometry(slotBasePlate, AssetLibrary.Meshes.BasePlate);
            NativeEntity.SetSlotMaterial(slotBasePlate, AssetLibrary.Materials.BasePlate);

            NativeEntity.Physicalize(physParams);
        }