コード例 #1
0
        /// <summary>
        ///     Initializes a new instance of this class.
        /// </summary>
        /// <param name="entity">Entity that will be moving.</param>
        /// <param name="x">X position to move to.</param>
        /// <param name="y">Y position to move to.</param>
        /// <param name="speed">Speed at which entity moves.</param>
        public EntityMoveToProcess(EntityNode entity, float x, float y, StartFinishF speed)
        {
            _entity = entity;
            _followSpeed = speed;
            _x = x;
            _y = y;

            Transformation entityTransform = _entity.CalculateTransformation();
            float vectorX = entityTransform.X - _x;
            float vectorY = entityTransform.Y - _y;
            _originalDistance = (float)Math.Sqrt(vectorX * vectorX + vectorY * vectorY);
        }
コード例 #2
0
        /// <summary>
        ///		Loads this modifier from a given binary reader.
        /// </summary>
        /// <param name="reader">Binary reader to load this modifier from.</param>
        public override void Load(BinaryReader reader)
        {
            // Load ze base!
            base.Load(reader);

            // Load properties.
            _xAcceleration = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _xAccelerationRandom = new MinMaxF(reader.ReadSingle(), reader.ReadSingle());
            _yAcceleration = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _yAccelerationRandom = new MinMaxF(reader.ReadSingle(), reader.ReadSingle());
        }
コード例 #3
0
 /// <summary>
 ///     Invoked when a new instance of this class is created.
 /// </summary>
 /// <param name="effectDuration">The start and finish time which the type effects particles in between.</param>
 /// <param name="xAcceleration">Acceleration on the x-axis.</param>
 /// <param name="yAcceleration">Acceleration on the y-axis.</param>
 /// <param name="xAccelerationRandom">Minimum and maximum randomization of acceleration on the x axis in the form of an array.</param>
 /// <param name="yAccelerationRandom">Minimum and maximum randomization of acceleration on the y axis in the form of an array.</param>
 public ParticleAccelerationModifier(StartFinish effectDuration, StartFinishF xAcceleration, StartFinishF yAcceleration, MinMaxF xAccelerationRandom, MinMaxF yAccelerationRandom)
 {
     _effectDuration = effectDuration;
     _xAcceleration = xAcceleration;
     _yAcceleration = yAcceleration;
     _xAccelerationRandom = xAccelerationRandom;
     _yAccelerationRandom = yAccelerationRandom;
 }
コード例 #4
0
        /// <summary>
        ///		Loads this modifier from a given binary reader.
        /// </summary>
        /// <param name="reader">Binary reader to load this modifier from.</param>
        public override void Load(BinaryReader reader)
        {
            // Load ze base!
            base.Load(reader);

            // Load properties.
            _xScale = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _xScaleRandom = new MinMaxF(reader.ReadSingle(), reader.ReadSingle());
            _yScale = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _yScaleRandom = new MinMaxF(reader.ReadSingle(), reader.ReadSingle());
            _zScale = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _zScaleRandom = new MinMaxF(reader.ReadSingle(), reader.ReadSingle());
        }
コード例 #5
0
 /// <summary>
 ///     Invoked when a new instance of this class is created.
 /// </summary>
 /// <param name="effectDuration">The start and finish time which the type effects particles in between.</param>
 /// <param name="xScale">Scale on the x-axis.</param>
 /// <param name="yScale">Scale on the y-axis.</param>
 /// <param name="zScale">Scale on the z-axis.</param>
 /// <param name="xScaleRandom">Minimum and maximum randomization of scale on the x axis in the form of an array.</param>
 /// <param name="yScaleRandom">Minimum and maximum randomization of scale on the y axis in the form of an array.</param>
 /// <param name="zScaleRandom">Minimum and maximum randomization of scale on the z axis in the form of an array.</param>
 public ParticleScaleModifier(StartFinish effectDuration, StartFinishF xScale, StartFinishF yScale, StartFinishF zScale, MinMaxF xScaleRandom, MinMaxF yScaleRandom, MinMaxF zScaleRandom)
 {
     _effectDuration = effectDuration;
     _xScale = xScale;
     _yScale = yScale;
     _zScale = zScale;
     _xScaleRandom = xScaleRandom;
     _yScaleRandom = yScaleRandom;
     _zScaleRandom = zScaleRandom;
 }
コード例 #6
0
 /// <summary>
 ///     Invoked when a new instance of this class is created.
 /// </summary>
 /// <param name="effectDuration">The start and finish time which the type effects particles in between.</param>
 /// <param name="xRotation">Rotation on the x-axis.</param>
 /// <param name="yRotation">Rotation on the y-axis.</param>
 /// <param name="zRotation">Rotation on the z-axis.</param>
 /// <param name="xScaleRotation">Minimum and maximum randomization of Rotation on the x axis in the form of an array.</param>
 /// <param name="yScaleRotation">Minimum and maximum randomization of Rotation on the y axis in the form of an array.</param>
 /// <param name="zScaleRotation">Minimum and maximum randomization of Rotation on the z axis in the form of an array.</param>
 public ParticleRotationModifier(StartFinish effectDuration, StartFinishF xRotation, StartFinishF yRotation, StartFinishF zRotation, MinMaxF xRotationRandom, MinMaxF yRotationRandom, MinMaxF zRotationRandom)
 {
     _effectDuration = effectDuration;
     _xRotation = xRotation;
     _yRotation = yRotation;
     _zRotation = zRotation;
     _xRotationRandom = xRotationRandom;
     _yRotationRandom = yRotationRandom;
     _zRotationRandom = zRotationRandom;
 }
コード例 #7
0
 /// <summary>
 ///		Initializes a new instance and gives it the specified  
 ///		name.
 /// </summary>
 /// <param name="name">Name to name as node to.</param>
 /// <param name="speed">Starting and finishing speed of this path marker.</param>
 public PathMarkerNode(string name, StartFinishF speed)
 {
     _name = name;
     _speed = Speed;
     _visible = false;
 }
コード例 #8
0
        /// <summary>
        ///		Loads this scene node from a given binary reader.
        /// </summary>
        /// <param name="reader">Binary reader to load this scene node from.</param>
        public override void Load(BinaryReader reader)
        {
            // Load all the basic entity details.
            base.Load(reader);

            // Load all the emitter specific details.
            _speed = new StartFinishF(reader.ReadSingle(), reader.ReadSingle());
            _delay = reader.ReadInt32();
            _nextNodeName = reader.ReadString();
        }