Open Reality Reference Guide
|
|
Go to the documentation of this file. 1 #ifndef __FBGEOMETRY_H__
2 #define __FBGEOMETRY_H__
43 #include <kaydaradef.h>
48 #define FBSDK_DLL K_DLLIMPORT
54 #ifdef FBSDKUseNamespace
55 namespace FBSDKNamespace {
61 enum FBGeometryPrimitiveType
63 kFBGeometry_POINTS = 0x0000,
64 kFBGeometry_LINES = 0x0001,
65 kFBGeometry_LINE_LOOP = 0x0002,
66 kFBGeometry_LINE_STRIP = 0x0003,
67 kFBGeometry_TRIANGLES = 0x0004,
68 kFBGeometry_TRIANGLE_STRIP = 0x0005,
69 kFBGeometry_TRIANGLE_FAN = 0x0006,
70 kFBGeometry_QUADS = 0x0007,
71 kFBGeometry_QUADS_STRIP = 0x0008,
72 kFBGeometry_POLYGON = 0x0009,
87 kFBGeometryArrayElementType_Unknown,
88 kFBGeometryArrayElementType_Integer,
89 kFBGeometryArrayElementType_Float,
90 kFBGeometryArrayElementType_Float2,
93 kFBGeometryArrayElementType_FloatMatrix4x4,
94 kFBGeometryArrayElementType_IntegerArrayPointer
115 kFBGeometryMapping_NONE,
116 kFBGeometryMapping_BY_CONTROL_POINT,
117 kFBGeometryMapping_BY_POLYGON_VERTEX,
118 kFBGeometryMapping_BY_POLYGON,
119 kFBGeometryMapping_BY_EDGE,
120 kFBGeometryMapping_ALL_SAME
136 kFBGeometryReference_DIRECT,
137 kFBGeometryReference_INDEX,
138 kFBGeometryReference_INDEX_TO_DIRECT
213 void VertexInit (
int pSize,
bool pResize,
bool pInitUV =
true,
bool pInitVertexColor =
false);
261 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz);
262 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz,
double UVu,
double UVv);
263 int VertexAdd (
double px,
double py,
double pz,
double nx,
double ny,
double nz,
double UVu,
double UVv,
double pRed,
double pGreen,
double pBlue,
double pAlpha);
279 bool VertexSet (
double px,
double py,
double pz,
int pIndex=-1);
328 bool VertexColorSet(
float pRed,
float pGreen,
float pBlue,
float pAlpha,
int pIndex=-1);
389 bool VertexArrayInit (
int pVertexcount,
bool pUniqueMaterial,
unsigned int pFBGeometryArrayIDs = 0);
580 void ShapeInit(
int pShapeIdx,
int pDiffSize,
bool pWithNormal =
false);
652 FBMesh(
const char* pName, HIObject pObject=NULL);
683 bool PolygonListAdd(
int pPolygonSize,
int pIndexArraySize,
int* pIndexArray,
int pMaterialId=0);
793 virtual void SurfaceBegin();
794 virtual void SurfaceEnd();
795 virtual void SurfaceEditBegin();
796 virtual void SurfaceEditEnd();
797 virtual bool GetSurfaceCapped(
int pUorV,
int pDirection );
798 virtual int GetVertexCount(
int pUorVorGlobal = -1 );
799 virtual void ControlPointsBegin() = 0;
800 virtual void SetControlPoint(
int pIndex,
double pX,
double pY,
double pZ,
double pW );
801 virtual void GetControlPoint(
int pIndex,
double &pX,
double &pY,
double &pZ,
double &pW );
802 virtual void ControlPointsEnd();
850 void FBSurfaceInitProperties();
878 FBNurbs(
const char* pName, HIObject pObject=NULL);
944 void FBNurbsInitProperties();
962 FBPatch(
const char* pName, HIObject pObject=NULL);
992 void FBPatchInitProperties();
996 #ifdef FBSDKUseNamespace
bool VertexNormalSet(FBNormal pVertex, int pIndex=-1)
Set a normal at a vertex.
class K_DLLIMPORT FBVector4< float > FBVertex
Vertex.
FBUV * GetUVSetDirectArray(int &pOutArrayCount, const char *pUVSetName=NULL) const
Get a pointer to the direct array of UVset Modify array value will be only effective when geometry ed...
FBUV VertexUVGet(int pIndex=-1) const
Get a UV coordinate.
FBPropertyInt UStep
Read Write Property: Step in U directions.
void ShapeClearAll()
Clears all the shapes.
@ kFBGeometryUpdateAll
control point add/remove, topology change, cluster/shape change and such events requiring regenerate ...
FBColorF * GetVertexColorsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of vertex color.
FBSurface(const char *pName, HIObject pObject=NULL)
Constructor.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBGeometryMappingMode GetUVSetMappingMode(const char *pUVSetName=NULL) const
Get UVSet mapping mode.
void ComputeVertexNormals(bool pCW=false)
Compute Mesh Vertex Normal.
@ kFBGeometryUpdateNone
no update done
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
int * GetVertexColorsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of vertex color.
@ kFBGeometryUpdatePositionAndNormal
only control point's position & normal change, so only update those values in the strip.
FBVertex VertexGet(int pIndex) const
Get a vertex.
bool VertexColorSet(FBColorF pColor, int pIndex=-1)
Set a Vertex Color.
int * GetTangentsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of tangents.
int VertexAdd(FBVertex pVertex, FBNormal pNormal, FBUV pUV)
Add a vertex.
FBPropertyGeometryMappingMode NormalMappingMode
Read Only Property: Normal mapping mode.
@ kFBSurfaceTypeBezier
Bezier surface.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBPropertyInt VSize
Read Write Property: Size in V directions.
bool VertexSetSelected(int pIndex, bool pState)
Set the selected state of a vertex.
bool VertexSet(double px, double py, double pz, int pIndex=-1)
Set a vertex.
FBNurbs(const char *pName, HIObject pObject=NULL)
Constructor.
FBPropertyNurbType VNurbType
Read Write Property: Nurbs Type for V direction.
FBPropertyBool UClosed
Read Write Property: U Closed.
@ kFBSurfaceModeHigh
High quality.
virtual double GetControlWeight(int pIndex)
Get weight of control point.
bool VertexClear()
Clear all Vertex arrays.
bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex &pPosDiff)
Set the differentiate point.
bool VertexGetVisible(int pIndex)
Get the visible state of a vertex.
const char * ShapeGetName(int pShapeIdx) const
Return the shape Name.
FBGeometryReferenceMode
Determine how the mapping information is stored in the array of coordinate.
FBMesh(const char *pName, HIObject pObject=NULL)
Constructor.
@ kFBGeometryArrayElementType_Float4
Each element is an array of 4 float.
@ kFBSurfaceTypeLinear
Linear surface.
FBSurfaceMode
Surface modes.
class K_DLLIMPORT FBVector4< float > FBColorF
Color float.
FBPropertyInt VStep
Read Write Property: Step in V directions.
void InverseNormal()
Inverse Normal.
FBVertex * GetVertexes() const
Get a pointer to the array of vertexes.
FBGeometryReferenceMode GetUVSetReferenceMode(const char *pUVSetName=NULL) const
Get UVSet reference mode.
virtual int GetKnotCount(int pUorV)
Number of knot vectors.
void ModifyNotify(kFBGeometryUpdateFlags pFlags=kFBGeometryUpdateAll, int pFirstIndex=-1, int pLastIndex=-1)
The geometry has change, update the necessary flags.
FBPropertyInt UOrder
Read Write Property: Nurbs U order.
int PolygonEnd()
End Polygon definition.
FBNormal * GetNormalsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of normals.
bool VertexNormalSet(double px, double py, double pz, int pIndex=-1)
Set a normal at a vertex.
bool VertexGetTransformable(int pU, int pV)
Get the Transformable state of a vertex.
FBPropertyGeometryReferenceMode TangentReferenceMode
Read Only Property: Tangent reference mode.
void ShapeInit(int pShapeIdx, int pDiffSize, bool pWithNormal=false)
Init the shape.
bool PolygonVertexAdd(int pVertex)
Add a vertex.
bool ShapeSetDiffPoint(int pShapeIdx, int pDiffIndex, int pOriIndex, const FBVertex &pPosDiff, const FBNormal &pNormalDiff)
Set the differentiate point.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz)
Begin geometry editing.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv)
Begin geometry editing.
class K_DLLIMPORT FBVector4< float > FBNormal
Normal.
virtual void SetControlMultiplicity(int pUorV, int pIndex, int pMultiplicity)
Set multiplicity (number of "instances") of control point.
int * GetBinormalsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of binormals.
int VertexAdd(FBVertex pVertex)
Add a vertex.
virtual void ControlPointsEnd() override
End NURBS control points edition.
int VertexAdd(double px, double py, double pz, double nx, double ny, double nz, double UVu, double UVv, double pRed, double pGreen, double pBlue, double pAlpha)
Begin geometry editing.
int * GetMaterialIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of Material.
virtual int GetControlMultiplicity(int pUorV, int pIndex)
Get multiplicity (number of "instances") of control point.
virtual void SurfaceEnd() override
End Patch definition.
int VertexAdd(double px, double py, double pz)
Add a vertex.
FBPropertyInt USize
Read Write Property: Size in U directions.
FBGeometry(const char *pName, HIObject pObject=NULL)
Constructor.
@ kFBGeometryArrayElementType_Float3
Each element is an array of 3 float.
bool PolygonListAdd(int pPolygonSize, int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Polygon List Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's re...
bool VertexArrayClear()
Clear all geometry vertex arrays.
virtual void SetControlKnotValue(int pUorV, int pIndex, double pKnotValue)
Set knot vector value of control point.
@ kFBGeometryArrayID_Point
ID to the Point array.
bool VertexSetVisible(int pIndex, bool pState)
Set the visible state of a vertex.
bool VertexColorSet(float pRed, float pGreen, float pBlue, float pAlpha, int pIndex=-1)
Set a UV coordinate.
FBGeometryMappingMode
Determine how the element is mapped on a surface.
@ kFBGeometryUpdateMappingMode
mapping mode request from associated shading network change.
bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int &pOriIndex, FBVertex &pPosDiff) const
Get the differentiate point.
bool VertexGetVisible(int pU, int pV)
Get the visible state of a vertex.
FBSurfaceType
Surface types.
@ kFBSurfaceModeRaw
Raw data.
FBPropertyGeometryMappingMode VertexColorMappingMode
Read Only Property: Vertex Color mapping mode.
@ kFBGeometryArrayID_Binormal
ID to the Binormal array.
int VertexCount() const
Get the number of vertices in the geometry.
int ShapeGetCount() const
Get Shape Count.
bool VertexSetSelected(int pU, int pV, bool pState)
Set the selected state of a vertex.
bool TriangleStripAdd(int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Triangle Strip Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's ...
bool ShapeGetDiffPoint(int pShapeIdx, int pDiffIndex, int &pOriIndex, FBVertex &pPosDiff, FBNormal &pNormalDiff) const
Get the differentiate point.
@ kFBSurfaceTypeBezierQuadric
Bezier Quadric surface.
int VertexAdd(FBVertex pVertex, FBNormal pNormal)
Add a vertex.
#define __FBClassDeclare(Name, Parent)
For internal use only.
virtual void SetControlWeight(int pIndex, double pWeight)
Set weight of control point.
FBPropertyInt VOrder
Read Write Property: Nurbs V order.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
virtual void SurfaceBegin() override
Begin Patch definition.
virtual void SurfaceEditBegin() override
Begin patch surface edit.
virtual void SurfaceEditEnd() override
End patch surface edit.
const int * PolygonVertexArrayGet(int &pArraySize) const
Get the array of polygon vertex (i.e.
virtual void SurfaceEnd() override
End NURBS definition.
FBVertex * GetPositionsArray(int &pOutArrayCount) const
Get a pointer to the position array.
int PolygonMaterialIdGet(int pIndex=-1) const
Get a Material ID for the given Polygon index.
FBPropertySurfaceMode SurfaceMode
Read Write Property: Surface mode.
FBPropertyGeometryMappingMode BinormalMappingMode
Read Only Property: Binormal mapping mode.
FBNormal VertexNormalGet(int pIndex=-1) const
Get a normal at a vertex.
virtual void SurfaceEditEnd() override
End NURBS surface edition.
int PolygonBegin(int pMaterialId=0)
Begin Polygon definition.
@ kFBNurbTypePeriodic
Periodic Type Nurb.
@ kFBGeometryUpdateInverseNormal
inverse normal request.
bool GeometryEnd()
End geometry editing.
bool VertexUVSet(FBUV pUV, int pIndex=-1)
Set a UV coordinate.
virtual double GetControlKnotValue(int pUorV, int pIndex)
Get knot vector value of control point.
bool VertexUVSet(float pU, float pV, int pIndex=-1)
Set a UV coordinate.
FBPropertyGeometryReferenceMode VertexColorReferenceMode
Read Only Property: Vertex Color reference mode.
@ kFBSurfaceTypeBspline
BSpline surface.
FBPropertySurfaceType USurfaceType
Read Write Property: Patch mode for U direction.
FBGeometryArrayElementType
Type of data when requesting an array.
int * GetNormalsIndexArray(int &pOutArrayCount) const
Get a pointer to the index array of normals.
@ kFBGeometryUpdateSkinWeight
update skin weight
FBNormal * GetTangentsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of tangents.
bool VertexGetTransformable(int pIndex)
Get the Transformable state of a vertex.
virtual void SurfaceEditBegin() override
Begin NURBS surface edition.
FBStringList GetUVSets() const
Get available UVSet name.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
FBColorF VertexColorGet(int pIndex=-1) const
Get a Vertex Color.
FBPropertyGeometryReferenceMode NormalReferenceMode
Read Only Property: Normal reference mode.
int ShapeGetDiffPointCount(int pShapeIdx) const
Return the shape's total diff points count.
bool IsTriangleMesh() const
Determines if the mesh is composed entirely of triangles.
@ kFBSurfaceModeHighNoNormals
High quality, no normals.
bool VertexSet(FBVertex pVertex, int pIndex=-1)
Set a vertex.
bool VertexSetVisible(int pU, int pV, bool pState)
Set the visible state of a vertex.
@ kFBNurbTypeOpen
Open Type Nurb.
virtual void SurfaceBegin() override
Begin NURBS definition.
virtual void ControlPointsBegin() override
Begin control points edition.
@ kFBNurbTypeClosed
Closed Type Nurb.
int VertexAdd(FBVertex pVertex, FBNormal pNormal, FBUV pUV, FBColorF pVertexColor)
Add a vertex.
Contains definitions for devices, boxes and models.
virtual void ControlPointsBegin() override
Begin NURBS control points edition.
bool VertexGetSelected(int pIndex)
Get the selected state of a vertex.
bool VertexArrayInit(int pVertexcount, bool pUniqueMaterial, unsigned int pFBGeometryArrayIDs=0)
Init geometry vertex arrays.
bool IsEditingEnabled() const
Is geometry editing enabled.
@ kFBSurfaceTypeCardinal
Cardinal surface.
FBPropertyGeometryReferenceMode BinormalReferenceMode
Read Only Property: Binormal reference mode.
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
int * GetUVSetIndexArray(int &pOutArrayCount, const char *pUVSetName=NULL) const
Get a pointer to the index array of UVset.
FBPatch(const char *pName, HIObject pObject=NULL)
Constructor.
@ kFBGeometryArrayID_Color
ID to the Vertex Color Array.
bool GeometryBegin()
Begin geometry editing.
FBGeometryArrayID
ID to use when requesting a specific array of data for a model.
@ kFBGeometryArrayID_Tangent
ID to the Tangent array.
bool TriangleListAdd(int pIndexArraySize, int *pIndexArray, int pMaterialId=0)
Add Triangle List, Must be called in-between FBGeometry::GeometryBegin() / GeometryEnd() It's user's ...
FBPropertyBool VClosed
Read Write Property: V Closed
virtual void ControlPointsEnd() override
End control points edition.
int PolygonCount() const
Get number of polygons in mesh.
FBPropertyNurbType UNurbType
Read Write Property: Nurbs Type for U direction.
int PolygonVertexIndex(int pPolygonIndex, int pVertexPolygonIndex) const
Get global (for the mesh) index of a vertex from a polygon.
void VertexInit(int pSize, bool pResize, bool pInitUV=true, bool pInitVertexColor=false)
Resize or Reserve vertex, normal and UV array for performance.
class K_DLLIMPORT FBVector2< float > FBUV
Represents a UV coordinate as a FBVector2 of floats in the range of 0.0f to 1.0f; value 0 is the U va...
MotionBuilder SDK base class.
FBPropertyGeometryMappingMode MaterialMappingMode
Read Property: Material mapping mode.
@ kFBSurfaceModeLow
Low quality.
bool VertexGetSelected(int pU, int pV)
Get the selected state of a vertex.
@ kFBSurfaceModeLowNoNormals
Low quality, no normals.
int PolygonVertexCount(int pPolygonIndex) const
Get Polygon vertex count.
FBPropertyGeometryMappingMode TangentMappingMode
Read Only Property: Tangent mapping mode.
FBNormal * GetBinormalsDirectArray(int &pOutArrayCount) const
Get a pointer to the direct array of binormals.
FBPropertySurfaceType VSurfaceType
Read Write Property: Patch mode for V direction.
@ kFBGeometryArrayID_Normal
ID to the Normal by Point array.
int ShapeAdd(const char *pName)
Add new shape.