Ejemplo n.º 1
0
        public void setupHUD()
        {
            hudScene.ProjectionMatrix = Matrix4.Identity;

            // HUD Triangle...
            //SSObject triObj = new SSObjectTriangle ();
            //hudScene.addObject (triObj);
            //triObj.Pos = new Vector3 (50, 50, 0);
            //triObj.Scale = new Vector3 (50.0f);

            // HUD text....
            fpsDisplay       = new SSObjectGDISurface_Text();
            fpsDisplay.Label = "FPS: ...";
            hudScene.AddObject(fpsDisplay);
            fpsDisplay.Pos   = new Vector3(10f, 10f, 0f);
            fpsDisplay.Scale = new Vector3(1.0f);

            // wireframe mode text....
            wireframeDisplay = new SSObjectGDISurface_Text();
            hudScene.AddObject(wireframeDisplay);
            wireframeDisplay.Pos   = new Vector3(10f, 40f, 0f);
            wireframeDisplay.Scale = new Vector3(1.0f);
            updateWireframeDisplayText(scene.DrawWireFrameMode);

            // HUD text....
            var testDisplay = new SSObject2DSurface_AGGText();

            testDisplay.Label = "TEST AGG";
            hudScene.AddObject(testDisplay);
            testDisplay.Pos   = new Vector3(50f, 100f, 0f);
            testDisplay.Scale = new Vector3(1.0f);
        }
Ejemplo n.º 2
0
        protected override void setupHUD()
        {
            base.setupHUD();

            // HUD text....
            var testDisplay = new SSObject2DSurface_AGGText();

            testDisplay.backgroundColor      = Color.Transparent;
            testDisplay.alphaBlendingEnabled = true;
            testDisplay.Label = "TEST AGG";
            hud2dScene.AddObject(testDisplay);
            testDisplay.Pos   = new Vector3(50f, 100f, 0f);
            testDisplay.Scale = new Vector3(1.0f);
        }
Ejemplo n.º 3
0
            public SSpaceMissileRenderInfo(SSpaceMissileVisualData missile)
            {
                this.missile = missile;
                var mParams = missile.parameters as SSpaceMissileVisualParameters;

                bodyObj       = new SSObjectMesh(mParams.missileBodyMesh());
                bodyObj.Scale = new Vector3(mParams.missileBodyScale);
                bodyObj.renderState.castsShadow     = false;
                bodyObj.renderState.receivesShadows = false;
                //bodyObj.renderState.visible = false;
                bodyObj.Name = "a missile body";

                #if MISSILE_DEBUG
                debugRays                = new MissileDebugRays(missile);
                debugCountdown           = new SSObject2DSurface_AGGText();
                debugCountdown.Size      = 2f;
                debugCountdown.MainColor = Color4Helper.RandomDebugColor();
                #endif

                flameSmokeEmitter = new SSRadialEmitter();
                flameSmokeEmitter.effectorMask            = (ushort)ParticleEffectorMasks.EjectionSmoke;
                flameSmokeEmitter.life                    = mParams.flameSmokeDuration;
                flameSmokeEmitter.color                   = new Color4(1f, 1f, 1f, 1f);
                flameSmokeEmitter.billboardXY             = true;
                flameSmokeEmitter.particlesPerEmissionMin = mParams.smokePerEmissionMin;
                flameSmokeEmitter.particlesPerEmissionMax = mParams.smokePerEmissionMax;
                flameSmokeEmitter.spriteRectangles        = mParams.smokeSpriteRects;
                //smokeEmitter.phiMin = 0f;
                //smokeEmitter.phiMax = (float)Math.PI/6f;
                flameSmokeEmitter.phiMin             = (float)Math.PI / 3f;
                flameSmokeEmitter.phiMax             = (float)Math.PI / 2f;
                flameSmokeEmitter.orientationMin     = new Vector3(0f, 0f, 0f);
                flameSmokeEmitter.orientationMax     = new Vector3(0f, 0f, 2f * (float)Math.PI);
                flameSmokeEmitter.angularVelocityMin = new Vector3(0f, 0f, -1f);
                flameSmokeEmitter.angularVelocityMax = new Vector3(0f, 0f, +1f);

                flameSmokeEmitter.radiusOffsetMin = 0f;
                flameSmokeEmitter.radiusOffsetMax = 0.1f;

                // positions emitters and mesh
                preRenderUpdate(0f);
            }
            public SSpaceMissileRenderInfo(SSpaceMissileData missile)
            {
                this.missile = missile;
                var mParams = missile.cluster.parameters;
                bodyObj = new SSObjectMesh(mParams.missileBodyMesh);
                bodyObj.Scale = new Vector3(mParams.missileBodyScale);
                bodyObj.renderState.castsShadow = false;
                bodyObj.renderState.receivesShadows = false;
                //bodyObj.renderState.visible = false;
                bodyObj.Name = "a missile body";

                #if MISSILE_DEBUG
                debugRays = new MissileDebugRays(missile);
                debugCountdown = new SSObject2DSurface_AGGText();
                debugCountdown.Size = 2f;
                debugCountdown.MainColor = Color4Helper.RandomDebugColor();
                #endif

                flameSmokeEmitter = new SSRadialEmitter();
                flameSmokeEmitter.effectorMask = (ushort)ParticleEffectorMasks.EjectionSmoke;
                flameSmokeEmitter.life = mParams.flameSmokeDuration;
                flameSmokeEmitter.color = new Color4(1f, 1f, 1f, 1f);
                flameSmokeEmitter.billboardXY = true;
                flameSmokeEmitter.particlesPerEmissionMin = mParams.smokePerEmissionMin;
                flameSmokeEmitter.particlesPerEmissionMax = mParams.smokePerEmissionMax;
                flameSmokeEmitter.spriteRectangles = mParams.smokeSpriteRects;
                //smokeEmitter.phiMin = 0f;
                //smokeEmitter.phiMax = (float)Math.PI/6f;
                flameSmokeEmitter.phiMin = (float)Math.PI/3f;
                flameSmokeEmitter.phiMax = (float)Math.PI/2f;
                flameSmokeEmitter.orientationMin = new Vector3 (0f, 0f, 0f);
                flameSmokeEmitter.orientationMax = new Vector3 (0f, 0f, 2f * (float)Math.PI);
                flameSmokeEmitter.angularVelocityMin = new Vector3 (0f, 0f, -1f);
                flameSmokeEmitter.angularVelocityMax = new Vector3 (0f, 0f, +1f);

                flameSmokeEmitter.radiusOffsetMin = 0f;
                flameSmokeEmitter.radiusOffsetMax = 0.1f;  

                // positions emitters and mesh
                preRenderUpdate(0f);
            }