Exemplo n.º 1
0
        public SSpaceMissileData(
            Vector3 missileWorldPos, Vector3 missileWorldVel,
            SSpaceMissileParameters parameters = null, ISSpaceMissileTarget target = null,
            float timeToHitTarget = 0f, ISharableData sharableData = null, AtTargetFunc atf = null)
        {
            _sharableData = sharableData ?? new SingleInstanceData()
            {
                target          = target,
                parameters      = parameters,
                timeSinceLaunch = 0f,
                timeToHit       = timeToHitTarget,
                atTargetFunc    = atf,
            };

            this.position = missileWorldPos;
            this.velocity = missileWorldVel;
        }
Exemplo n.º 2
0
        public SSpaceMissileVisualData(
            Vector3 missileWorldPos, Vector3 missileWorldVel,
            SSpaceMissileParameters parameters = null, ISSpaceMissileTarget target      = null, AtTargetFunc atf = null,
            float ejectionYawVelocity          = float.NaN, float ejectionPitchVelocity = float.NaN)
            : base(missileWorldPos, missileWorldVel, parameters, target)
        {
            var ejectionAsVisual = _driver as SMissileEjectionVisualDriver;

            if (!float.IsNaN(ejectionYawVelocity))
            {
                ejectionAsVisual.yawVelocity = ejectionYawVelocity;
            }
            if (!float.IsNaN(ejectionPitchVelocity))
            {
                ejectionAsVisual.pitchVelocity = ejectionPitchVelocity;
            }
        }