Example #1
0
        public Trigger(ICore core)
            : base(core)
        {
            this.core = core;
            Name = core.GetName<Trigger>();
            Color = new MyColor(0, 255, 0);

            mesh = core.Scene.CreateMeshBuilder();
            mesh.CreateBox(1f, 1f, 1f, false);
            mesh.SetColor(core.Globals.RGBA(Color.R / 255f, Color.G / 255f, Color.B / 255f, 1));
            mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED);
            mesh.SetAlphaTest(true);
            mesh.SetBlendingMode(CONST_TV_BLENDINGMODE.TV_BLEND_ADD);

            UniqueId = mesh.GetMeshName();
        }
Example #2
0
        public Trigger(ICore core)
            : base(core)
        {
            this.core = core;
            Name      = core.GetName <Trigger>();
            Color     = new MyColor(0, 255, 0);

            mesh = core.Scene.CreateMeshBuilder();
            mesh.CreateBox(1f, 1f, 1f, false);
            mesh.SetColor(core.Globals.RGBA(Color.R / 255f, Color.G / 255f, Color.B / 255f, 1));
            mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED);
            mesh.SetAlphaTest(true);
            mesh.SetBlendingMode(CONST_TV_BLENDINGMODE.TV_BLEND_ADD);

            UniqueId = mesh.GetMeshName();
        }
Example #3
0
        public override void Initialize()
        {
#if DEBUG
            Show = true;
#endif
            TVMesh mesh = Scene.CreateMeshBuilder(Name);
            mesh.CreateBox(1, 1, 1);
            mesh.SetPosition(Position.x, Position.y, Position.z);
            mesh.SetRotation(Rotation.x, Rotation.y, Rotation.z);
            mesh.SetScale(Scale.x, Scale.y, Scale.z);
            mesh.GetBoundingBox(ref boundingBoxMin, ref boundingBoxMax);
            mesh.Destroy();
            mesh = null;

            // Register object in Lua.
            ScriptManager.SetGlobal(Name, this);
        }