From a786dd45a4ebc6b91936b5e46d0ef0a9befc05af Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sun, 2 Aug 2020 19:36:50 +0300 Subject: Move sdk and eax --- sdk/rwsdk/include/d3d8/rpskin.h | 222 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 sdk/rwsdk/include/d3d8/rpskin.h (limited to 'sdk/rwsdk/include/d3d8/rpskin.h') diff --git a/sdk/rwsdk/include/d3d8/rpskin.h b/sdk/rwsdk/include/d3d8/rpskin.h new file mode 100644 index 00000000..df446c1b --- /dev/null +++ b/sdk/rwsdk/include/d3d8/rpskin.h @@ -0,0 +1,222 @@ + +#ifndef RPSKIN_H +#define RPSKIN_H + +/** + * \defgroup rpskin RpSkin + * \ingroup rpplugin + * + * Skin Plugin for RenderWare Graphics. + */ + +/*===========================================================================* + *--- Include files ---------------------------------------------------------* + *===========================================================================*/ +#include "rwcore.h" +#include "rpworld.h" + +#include "rpcriter.h" +#include "rpskin.rpe" + +#include "rphanim.h" + +/*===========================================================================* + *--- Global Types ----------------------------------------------------------* + *===========================================================================*/ +typedef struct RwMatrixWeights RwMatrixWeights; + +/** + * \ingroup rpskin + * \struct RwMatrixWeights + * A structure for defining up to four matrix weights per vertex. + * Not all entries need to be used. + * + * \note + * Values should be sorted, such that any zero 0.0f entries appear + * after the valid weights. Any weights that appear after a zero + * entry will be ignored. + * + * \see RpSkinCreate + */ +struct RwMatrixWeights +{ + RwReal w0; /**< The first matrix weight. */ + RwReal w1; /**< The second matrix weight. */ + RwReal w2; /**< The third matrix weight. */ + RwReal w3; /**< The fourth matrix weight. */ +}; + +/** + * \ingroup rpskin + * \typedef RpSkin + * + * Skin object. This should be considered an opaque type. + * Use the RpSkin API functions to access. + * + * \see RpSkinCreate + * \see RpSkinDestroy + */ +typedef struct RpSkin RpSkin; + +/*===========================================================================* + *--- Plugin API Functions --------------------------------------------------* + *===========================================================================*/ +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +/*---------------------------------------------------------------------------* + *- Plugin functions -* + *---------------------------------------------------------------------------*/ +extern RwBool +RpSkinPluginAttach(void); + +/*---------------------------------------------------------------------------* + *- Skin Atomic functions -* + *---------------------------------------------------------------------------*/ +extern RpAtomic * +RpSkinAtomicSetHAnimHierarchy( RpAtomic *atomic, + RpHAnimHierarchy *hierarchy ); + +extern RpHAnimHierarchy * +RpSkinAtomicGetHAnimHierarchy( const RpAtomic *atomic ); + +/*---------------------------------------------------------------------------* + *- Skin Geometry functions -* + *---------------------------------------------------------------------------*/ +extern RpGeometry * +RpSkinGeometrySetSkin( RpGeometry *geometry, + RpSkin *skin ); + +extern RpSkin * +RpSkinGeometryGetSkin( RpGeometry *geometry ); + +extern RpSkin * +RpSkinCreate( RwUInt32 numVertices, + RwUInt32 numBones, + RwMatrixWeights *vertexWeights, + RwUInt32 *vertexIndices, + RwMatrix *inverseMatrices ); + +extern RpSkin * +RpSkinDestroy( RpSkin *skin ); + +extern RwUInt32 +RpSkinGetNumBones( RpSkin *skin ); + +extern const RwMatrixWeights * +RpSkinGetVertexBoneWeights( RpSkin *skin ); + +extern const RwUInt32 * +RpSkinGetVertexBoneIndices( RpSkin *skin ); + +extern const RwMatrix * +RpSkinGetSkinToBoneMatrices( RpSkin *skin ); + +/*---------------------------------------------------------------------------* + *- Skin pipeline -* + *---------------------------------------------------------------------------*/ + +/** + * \ingroup rpskin + * \ref RpSkinType defines the different ways a skinned atomic can + * be rendered. Once a skinned \ref RpGeometry has been attached to + * an \ref RpAtomic the atomic must be setup with the correct skin + * rendering pipeline with \ref RpSkinAtomicSetType. + */ +enum RpSkinType +{ + rpNASKINTYPE = 0, /**