public VertexAnimationTrack(Animation parent, ushort handle, VertexAnimationType animType, VertexData targetData) : this(OgrePINVOKE.new_VertexAnimationTrack__SWIG_2(Animation.getCPtr(parent), handle, (int)animType, VertexData.getCPtr(targetData)), true)
 {
     if (OgrePINVOKE.SWIGPendingException.Pending)
     {
         throw OgrePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 2
0
 /// Constructor, associates with target VertexData and temp buffer (for software)
 public VertexAnimationTrack(Animation parent, VertexAnimationType animationType,
                             VertexData targetVertexData, VertexAnimationTargetMode targetMode) : base(parent)
 {
     this.animationType    = animationType;
     this.targetVertexData = targetVertexData;
     this.targetMode       = targetMode;
 }
Esempio n. 3
0
        /// <summary>
        ///		Creates a new VertexAnimationTrack automatically associated with a Vertex.
        /// </summary>
        /// <param name="index">Handle to give the track, used for accessing the track later.</param>
        /// <param name="target">Vertex object which will be affected by this track.</param>
        /// <returns></returns>
        public VertexAnimationTrack CreateVertexTrack(ushort handle, VertexData targetVertexData,
                                                      VertexAnimationType type)
        {
            // create a new track and set it's target
            VertexAnimationTrack track = CreateVertexTrack(handle, type);

            track.TargetVertexData = targetVertexData;
            return(track);
        }
Esempio n. 4
0
        /// <summary>
        ///		Creates an VertexAnimationTrack.
        /// </summary>
        /// <param name="handle">Handle to give the track, used for accessing the track later.</param>
        /// <returns></returns>
        public VertexAnimationTrack CreateVertexTrack(ushort handle, VertexAnimationType animType)
        {
            VertexAnimationTrack track = new VertexAnimationTrack(this, handle, animType);

            // add the track to the list
            vertexTrackList[handle] = track;

            return(track);
        }
Esempio n. 5
0
        public virtual VertexAnimationType getSharedVertexDataAnimationType()
        {
            VertexAnimationType ret = (VertexAnimationType)OgrePINVOKE.Mesh_getSharedVertexDataAnimationType(swigCPtr);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public VertexAnimationType getAnimationType()
        {
            VertexAnimationType ret = (VertexAnimationType)OgrePINVOKE.VertexAnimationTrack_getAnimationType(swigCPtr);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 7
0
        public VertexAnimationTrack createVertexTrack(ushort handle, VertexAnimationType animType)
        {
            global::System.IntPtr cPtr = OgrePINVOKE.Animation_createVertexTrack__SWIG_0(swigCPtr, handle, (int)animType);
            VertexAnimationTrack  ret  = (cPtr == global::System.IntPtr.Zero) ? null : new VertexAnimationTrack(cPtr, false);

            if (OgrePINVOKE.SWIGPendingException.Pending)
            {
                throw OgrePINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 8
0
	    /// <summary>
	    ///		Creates a new VertexAnimationTrack automatically associated with a Vertex. 
	    /// </summary>
	    /// <param name="handle">Handle to give the track, used for accessing the track later.</param>
	    /// <param name="targetVertexData">Vertex object which will be affected by this track.</param>
	    /// <param name="type"></param>
	    /// <returns></returns>
	    public VertexAnimationTrack CreateVertexTrack( ushort handle, VertexData targetVertexData,
													  VertexAnimationType type )
		{
			// create a new track and set it's target
			VertexAnimationTrack track = CreateVertexTrack( handle, type );
			track.TargetVertexData = targetVertexData;
			return track;
		}
Esempio n. 9
0
		/// <summary>
		///	    Internal method which, if animation types have not been determined,
		///	    scans any vertex animations and determines the type for each set of
		///	    vertex data (cannot have 2 different types).
		/// </summary>
		public void DetermineAnimationTypes()
		{
			// Don't check flag here; since detail checks on track changes are not
			// done, allow caller to force if they need to

			// Initialize all types to nothing
			this._sharedVertexDataAnimationType = VertexAnimationType.None;
			for ( var sm = 0; sm < SubMeshCount; sm++ )
			{
				var subMesh = GetSubMesh( sm );
				subMesh.VertexAnimationType = VertexAnimationType.None;
			}

			// Scan all animations and determine the type of animation tracks
			// relating to each vertex data
			foreach ( var anim in this._animationsList.Values )
			{
				foreach ( var track in anim.VertexTracks.Values )
				{
					var handle = track.Handle;
					if ( handle == 0 )
					{
						// shared data
						if ( this._sharedVertexDataAnimationType != VertexAnimationType.None &&
						     this._sharedVertexDataAnimationType != track.AnimationType )
						{
							// Mixing of morph and pose animation on same data is not allowed
							throw new Exception( "Animation tracks for shared vertex data on mesh " + Name +
							                     " try to mix vertex animation types, which is " +
							                     "not allowed, in Mesh.DetermineAnimationTypes" );
						}
						this._sharedVertexDataAnimationType = track.AnimationType;
					}
					else
					{
						// submesh index (-1)
						var sm = GetSubMesh( handle - 1 );
						if ( sm.CurrentVertexAnimationType != VertexAnimationType.None &&
						     sm.CurrentVertexAnimationType != track.AnimationType )
						{
							// Mixing of morph and pose animation on same data is not allowed
							throw new Exception(
								string.Format( "Animation tracks for dedicated vertex data {0}  on mesh {1}", handle - 1, Name ) +
								" try to mix vertex animation types, which is " + "not allowed, in Mesh.DetermineAnimationTypes" );
						}
						sm.VertexAnimationType = track.AnimationType;
					}
				}
			}

			this._animationTypesDirty = false;
		}
Esempio n. 10
0
 public VertexAnimationTrack(Animation parent, ushort handle, VertexAnimationType animationType)
     : base(parent, handle)
 {
     this.animationType = animationType;
 }
Esempio n. 11
0
 /// Constructor
 public VertexAnimationTrack(Animation parent, VertexAnimationType animationType)
     : base(parent)
 {
     this.animationType = animationType;
 }
Esempio n. 12
0
		public VertexAnimationTrack( Animation parent, ushort handle, VertexAnimationType animationType )
			: base( parent, handle )
		{
			this.animationType = animationType;
		}
Esempio n. 13
0
 private static extern IntPtr Animation_createVertexTrack(IntPtr animation, ushort handle, VertexAnimationType animType);
Esempio n. 14
0
 /// <summary>
 /// Creates a VertexAnimationTrack for animating vertex position data.
 /// </summary>
 /// <param name="handle">Handle to give the track, used for accessing the track later. Must be unique within this Animation, and is used to identify the target. For example when applied to a Mesh, the handle must reference the index of the geometry being modified; 0 for the shared geometry, and 1+ for SubMesh geometry with the same index-1.</param>
 /// <param name="animType">Either morph or pose animation.</param>
 /// <returns>The newly created VertexAnimationTrack or null if an error occured such as the track already being defined.</returns>
 public VertexAnimationTrack createVertexTrack(ushort handle, VertexAnimationType animType)
 {
     return(vertexAnimations.getObject(Animation_createVertexTrack(animation, handle, animType), this));
 }
Esempio n. 15
0
		/// Constructor
		public VertexAnimationTrack( Animation parent, VertexAnimationType animationType )
			: base( parent )
		{
			this.animationType = animationType;
		}
Esempio n. 16
0
	    /// <summary>
	    ///		Creates an VertexAnimationTrack. 
	    /// </summary>
	    /// <param name="handle">Handle to give the track, used for accessing the track later.</param>
	    /// <param name="animType"></param>
	    /// <returns></returns>
	    public VertexAnimationTrack CreateVertexTrack( ushort handle, VertexAnimationType animType )
		{
			VertexAnimationTrack track = new VertexAnimationTrack( this, handle, animType );

			// add the track to the list
			vertexTrackList[ handle ] = track;

			return track;
		}
Esempio n. 17
0
		/// Constructor, associates with target VertexData and temp buffer (for software)
		public VertexAnimationTrack( Animation parent, VertexAnimationType animationType,
									VertexData targetVertexData, VertexAnimationTargetMode targetMode )
			: base( parent )
		{
			this.animationType = animationType;
			this.targetVertexData = targetVertexData;
			this.targetMode = targetMode;
		}