UE1:RSkeletalMeshEx: Difference between revisions
mNo edit summary |
|||
Line 10: | Line 10: | ||
* implements AttachToBone function | * implements AttachToBone function | ||
==RSkeletalMeshEx | ==RSkeletalMeshEx== | ||
This object holds all SkeletalMesh related functions. | |||
===function GetBoneDetails=== | ===Static functions=== | ||
====function GetBoneDetails==== | |||
<uscript>native static final function GetBoneDetails(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative, out rotator Orientation, out vector Position, out float Length, out vector Size);</uscript> | <uscript>native static final function GetBoneDetails(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative, out rotator Orientation, out vector Position, out float Length, out vector Size);</uscript> | ||
Returns bone details as output parameters | Returns bone details as output parameters | ||
Line 27: | Line 28: | ||
===function GetBoneLocation=== | ====function GetBoneLocation==== | ||
<uscript>native static final function vector GetBoneLocation(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative);</uscript> | <uscript>native static final function vector GetBoneLocation(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative);</uscript> | ||
Returns bone position | Returns bone position | ||
Line 37: | Line 38: | ||
===function GetBoneRotation=== | ====function GetBoneRotation==== | ||
<uscript> | <uscript>native static final function rotator GetBoneRotation(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative);</uscript> | ||
Returns bone orientation | Returns bone orientation | ||
Line 46: | Line 47: | ||
* bool bNoRelative - if false, it'll also take all root bones | * bool bNoRelative - if false, it'll also take all root bones | ||
===function BoneExists=== | ====function BoneExists==== | ||
<uscript>native static final function bool BoneExists(SkeletalMesh SkeletalMesh, string BoneName);</uscript> | <uscript>native static final function bool BoneExists(SkeletalMesh SkeletalMesh, string BoneName);</uscript> | ||
Returns whenever given bone exists or not | Returns whenever given bone exists or not | ||
Line 54: | Line 55: | ||
* string BoneName - bone name. Eg. "Bip01 R Finger1" | * string BoneName - bone name. Eg. "Bip01 R Finger1" | ||
===function GetNumBones=== | ====function GetNumBones==== | ||
<uscript>native static final function int GetNumBones(SkeletalMesh SkeletalMesh);</uscript> | <uscript>native static final function int GetNumBones(SkeletalMesh SkeletalMesh);</uscript> | ||
Returns number of bones in given skeletal mesh | Returns number of bones in given skeletal mesh | ||
Line 62: | Line 63: | ||
===function GetBoneNameByIndex=== | ====function GetBoneNameByIndex==== | ||
<uscript>native static final function name GetBoneNameByIndex(SkeletalMesh SkeletalMesh, int index);</uscript> | <uscript>native static final function name GetBoneNameByIndex(SkeletalMesh SkeletalMesh, int index);</uscript> | ||
Returns bone name | Returns bone name | ||
Line 69: | Line 70: | ||
* SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh) | * SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh) | ||
* int index - bone index (use GetNumBones to have list of all bones) | * int index - bone index (use GetNumBones to have list of all bones) | ||
====function GetBoneIndex==== | |||
<uscript>native static final function int GetBoneIndex(SkeletalMesh SkeletalMesh, string BoneName);</uscript> | |||
Returns bone index or -1 if bone can not be found. | |||
input parameters: | |||
* SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh) | |||
* string BoneName - bone name. Eg. "Bip01 R Finger1" | |||
====function GetBoneLocationByIndex==== | |||
<uscript>native static final function vector GetBoneLocationByIndex(SkeletalMesh SkeletalMesh, int index, bool bNoRelative);</uscript> | |||
Returns bone position | |||
input parameters: | |||
* SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh) | |||
* int index - bone index (use GetNumBones to have list of all bones) | |||
* bool bNoRelative - if false, it'll also take all root bones | |||
====function GetBoneRotationByIndex==== | |||
<uscript>native static final function rotator GetBoneRotationByIndex(SkeletalMesh SkeletalMesh, int index, bool bNoRelative);</uscript> | |||
Returns bone orientation | |||
input parameters: | |||
* SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh) | |||
* int index - bone index (use GetNumBones to have list of all bones) | |||
* bool bNoRelative - if false, it'll also take all root bones | |||
==RSkeletalActor== | ==RSkeletalActor== | ||
This actor implements AttachToBone function. | |||
===Variables=== | ===Variables=== | ||
Line 79: | Line 111: | ||
* vector LocationOffset - location offset (relative to bone location) | * vector LocationOffset - location offset (relative to bone location) | ||
=== | ===Functions=== | ||
====AttachToBone==== | ====AttachToBone==== | ||
Line 112: | Line 144: | ||
*'''Raven''' - whole code :) | *'''Raven''' - whole code :) | ||
*'''Astyanax''' - quaternion to rotator function (found somewhere at BU) | *'''Astyanax''' - quaternion to rotator function (found somewhere at BU) | ||
*''' Smirftsch ''' - being patient to my noob C++ questions :P | *'''Smirftsch''' - being patient to my noob C++ questions :P | ||
*'''.:..:''' - for help with AttachToBone update stuff |
Revision as of 09:16, 23 June 2008
About
I've wrote extended skeletal animation support. Features:
- returns bone details (position, orientation, etc)
- returns whenever bone exists or not
- returns number of bones
- returns bone name by index
- implements AttachToBone function
RSkeletalMeshEx
This object holds all SkeletalMesh related functions.
Static functions
function GetBoneDetails
<uscript>native static final function GetBoneDetails(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative, out rotator Orientation, out vector Position, out float Length, out vector Size);</uscript> Returns bone details as output parameters
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- string BoneName - bone name. Eg. "Bip01 R Finger1"
- bool bNoRelative - if false, it'll also take all root bones position/orientation into account
output parameters
- rotator Orientation - bone rotation
- vector Position - bone position
- float Length - bone lenght
- vector Size - bone size
function GetBoneLocation
<uscript>native static final function vector GetBoneLocation(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative);</uscript> Returns bone position
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- string BoneName - bone name. Eg. "Bip01 R Finger1"
- bool bNoRelative - if false, it'll also take all root bones
function GetBoneRotation
<uscript>native static final function rotator GetBoneRotation(SkeletalMesh SkeletalMesh, string BoneName, bool bNoRelative);</uscript> Returns bone orientation
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- string BoneName - bone name. Eg. "Bip01 R Finger1"
- bool bNoRelative - if false, it'll also take all root bones
function BoneExists
<uscript>native static final function bool BoneExists(SkeletalMesh SkeletalMesh, string BoneName);</uscript> Returns whenever given bone exists or not
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- string BoneName - bone name. Eg. "Bip01 R Finger1"
function GetNumBones
<uscript>native static final function int GetNumBones(SkeletalMesh SkeletalMesh);</uscript> Returns number of bones in given skeletal mesh
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
function GetBoneNameByIndex
<uscript>native static final function name GetBoneNameByIndex(SkeletalMesh SkeletalMesh, int index);</uscript> Returns bone name
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- int index - bone index (use GetNumBones to have list of all bones)
function GetBoneIndex
<uscript>native static final function int GetBoneIndex(SkeletalMesh SkeletalMesh, string BoneName);</uscript> Returns bone index or -1 if bone can not be found.
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- string BoneName - bone name. Eg. "Bip01 R Finger1"
function GetBoneLocationByIndex
<uscript>native static final function vector GetBoneLocationByIndex(SkeletalMesh SkeletalMesh, int index, bool bNoRelative);</uscript> Returns bone position
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- int index - bone index (use GetNumBones to have list of all bones)
- bool bNoRelative - if false, it'll also take all root bones
function GetBoneRotationByIndex
<uscript>native static final function rotator GetBoneRotationByIndex(SkeletalMesh SkeletalMesh, int index, bool bNoRelative);</uscript> Returns bone orientation
input parameters:
- SkeletalMesh - skeletal mesh. Can look like: SkeletalMesh(Mesh)
- int index - bone index (use GetNumBones to have list of all bones)
- bool bNoRelative - if false, it'll also take all root bones
RSkeletalActor
This actor implements AttachToBone function.
Variables
- bool bUpdateRotation - if true, rotation will also be updated
- bool bDisableNativeUpdate - if true, native update will be disabled. In order to update location you'll have to yse UpdateAttached function.
- rotator RotationOffset - rotation offset (relative to bone rotation)
- vector LocationOffset - location offset (relative to bone location)
Functions
AttachToBone
<uscript>native final function bool AttachToBone(Actor ABase , string Bone);</uscript> When called will attach itself into ABase bone.
input parameters:
- Actor ABase - actor we'll be attached to
- string BoneName - bone name. Eg. "Bip01 R Finger1"
UpdateAttached
<uscript>native final function UpdateAttached();</uscript> Updates actor location (can be used only if bDisableNativeUpdate is true)
DetachFromBone
<uscript>native final function DetachFromBone();</uscript> If called will detach itself from attached actor.
Changelog
- v 0.0.2
- added native class RSkeletalActor which implements AttachToBone function
- v 0.0.1 (first public release)
- added function GetBoneRotation and GetBoneLocation
Download
As always source code is included in zip file.
link: RSkeletalMeshEx (~51kb)
Credits
- Raven - whole code :)
- Astyanax - quaternion to rotator function (found somewhere at BU)
- Smirftsch - being patient to my noob C++ questions :P
- .:..: - for help with AttachToBone update stuff