Exemplo n.º 1
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);
            }