public Object Clone()
        {
            PMatrix r = new PMatrix();

            r.Multiply(this);
            return(r);
        }
Esempio n. 2
0
		/// <summary>
		/// Returns the product of the matrices from the top-most ancestor node (the last node
		/// in the list) to the given node.
		/// </summary>
		/// <param name="nodeOnPath">
		/// The bottom-most node in the path for which the matrix product will be computed.
		/// </param>
		/// <returns>
		/// The product of the matrices from the top-most node to the given node.
		/// </returns>
		public virtual PMatrix GetPathTransformTo(PNode nodeOnPath) {
			PMatrix aMatrix = new PMatrix();

			object[] matrices = matrixStack.ToArray();
			int count = matrices.Length;
			for (int i = count - 1; i >= 0; i--) {
				PTuple each = (PTuple) matrices[i];
				if (each.matrix != null) aMatrix.Multiply(each.matrix);
				if (nodeOnPath == each.node) {
					return aMatrix;
				}
			}
		
			return aMatrix;
		}
        /// <summary>
        /// Constructs a new PTransformActivity that animate between the source and destination
        /// matrices in the order specified by the mode, looping the given number of iterations.
        /// </summary>
        /// <param name="duration">The length of one loop of the activity.</param>
        /// <param name="stepInterval">
        /// The minimum number of milliseconds that this activity should delay between steps.
        /// </param>
        /// <param name="loopCount">
        /// The number of times the activity should reschedule itself.
        /// </param>
        /// <param name="mode">
        /// Defines how the activity interpolates between states.
        /// </param>
        /// <param name="aTarget">
        /// The object that the activity will be applied to and where the source
        /// state will be taken from.
        /// </param>
        /// <param name="aDestination">The destination matrix.</param>
        public PTransformActivity(long duration, long stepInterval, int loopCount, ActivityMode mode, Target aTarget, PMatrix aDestination)
            : base(duration, stepInterval, loopCount, mode)
        {
            //source = new float[6];
            //destination = new float[6];
            target = aTarget;
            //if (aDestination != null) {
            //	destination = aDestination.MatrixReference.Elements;
            //}

            source = new PMatrix();
            destination = new PMatrix();
            destination.Multiply(aDestination);
        }
Esempio n. 4
0
 public Object Clone()
 {
     PMatrix r = new PMatrix();
     r.Multiply(this);
     return r;
 }