Represents a static object that can be rendered in the scene, represented by the .CGF format. More...
#include
Inherits IMeshObj, and IStreamable.
Classes | |
struct | SStatistics |
Statistics information about this object. More... | |
Public Types | |
enum | ELoadingFlags { ELoadingFlagsPreviewMode = BIT(0), ELoadingFlagsForceBreakable = BIT(1), ELoadingFlagsIgnoreLoDs = BIT(2), ELoadingFlagsTessellate = BIT(3), ELoadingFlagsJustGeometry = BIT(4) } |
Loading flags. More... | |
Public Member Functions | |
virtual void | SetFlags (int nFlags)=0 |
virtual int | GetFlags () const =0 |
Retrieve flags set on the static object. | |
virtual unsigned int | GetVehicleOnlyPhysics ()=0 |
Retrieves the internal flag m_nVehicleOnlyPhysics. | |
virtual int | GetIDMatBreakable ()=0 |
Retrieves the internal flag m_nIdMaterialBreakable. | |
virtual unsigned int | GetBreakableByGame ()=0 |
Retrieves the internal flag m_bBreakableByGame. | |
virtual struct IIndexedMesh * | GetIndexedMesh (bool bCreateIfNone=false)=0 |
virtual struct IIndexedMesh * | CreateIndexedMesh ()=0 |
virtual int | PhysicalizeFoliage (IPhysicalEntity *pTrunk, const Matrix34 &mtxWorld, struct IFoliage *&pRes, float lifeTime=0.0f, int iSource=0)=0 |
virtual IStatObj * | UpdateVertices (strided_pointer< Vec3 > pVtx, strided_pointer< Vec3 > pNormals, int iVtx0, int nVtx, int *pVtxMap=0, float rscale=1.f)=0 |
virtual IStatObj * | SkinVertices (strided_pointer< Vec3 > pSkelVtx, const Matrix34 &mtxSkelToMesh)=0 |
virtual void | CopyFoliageData (IStatObj *pObjDst, bool bMove=false, IFoliage *pSrcFoliage=0, int *pVtxMap=0, primitives::box *pMovedBoxes=0, int nMovedBoxes=-1)=0 |
virtual void | SetPhysGeom (phys_geometry *pPhysGeom, int nType=0)=0 |
virtual ITetrLattice * | GetTetrLattice ()=0 |
Returns a tetrahedral lattice, if any (used for breakable objects) | |
virtual float | GetAIVegetationRadius () const =0 |
virtual void | SetAIVegetationRadius (float radius)=0 |
virtual void | SetMaterial (IMaterial *pMaterial)=0 |
ILINE Vec3 | GetBoxMin () const |
ILINE Vec3 | GetBoxMax () const |
virtual const Vec3 | GetVegCenter ()=0 |
virtual void | SetBBoxMin (const Vec3 &vBBoxMin)=0 |
virtual void | SetBBoxMax (const Vec3 &vBBoxMax)=0 |
virtual void | Refresh (int nFlags)=0 |
virtual IStatObj * | GetLodObject (int nLodLevel, bool bReturnNearest=false)=0 |
virtual void | SetLodObject (int nLodLevel, IStatObj *pLod)=0 |
virtual IStatObj * | GetLowestLod ()=0 |
virtual int | FindNearesLoadedLOD (int nLodIn, bool bSearchUp=false)=0 |
virtual int | FindHighestLOD (int nBias)=0 |
virtual const char * | GetFilePath ()=0 |
virtual void | SetFilePath (const char *szFileName)=0 |
virtual const char * | GetGeoName ()=0 |
virtual void | SetGeoName (const char *szGeoName)=0 |
Sets the name of the geometry. | |
virtual bool | IsSameObject (const char *szFileName, const char *szGeomName)=0 |
virtual Vec3 | GetHelperPos (const char *szHelperName)=0 |
virtual const Matrix34 & | GetHelperTM (const char *szHelperName)=0 |
Gets the transformation matrix of a specified helper, see GetHelperPos. | |
virtual bool | IsDefaultObject ()=0 |
Tell us if the object is not found. | |
virtual void | FreeIndexedMesh ()=0 |
Free the geometry data. | |
virtual void | GetMemoryUsage (class ICrySizer *pSizer) const =0 |
Pushes the underlying tree of objects into the given Sizer object for statistics gathering. | |
virtual float | GetRadiusVert () const =0 |
Used for sprites. | |
virtual float | GetRadiusHors () const =0 |
Used for sprites. | |
virtual bool | IsPhysicsExist () const =0 |
Determines if the object has physics capabilities. | |
virtual struct IStatObj * | GetIStatObj () |
virtual void | Invalidate (bool bPhysics=false, float tolerance=0.05f)=0 |
virtual int | GetSubObjectCount () const =0 |
Retrieve number of sub-objects. | |
virtual void | SetSubObjectCount (int nCount)=0 |
Sets number of sub-objects. | |
virtual IStatObj::SSubObject * | GetSubObject (int nIndex)=0 |
Retrieve sub object by index, where 0 <= nIndex < GetSubObjectCount() | |
virtual bool | IsSubObject () const =0 |
Check if this object is sub object of another IStatObj. | |
virtual IStatObj * | GetParentObject () const =0 |
Retrieve parent static object, only relevant when this IStatObj is Sub-object. | |
virtual IStatObj * | GetCloneSourceObject () const =0 |
Retrieve the static object, from which this one was cloned (if that is the case) | |
virtual IStatObj::SSubObject * | FindSubObject (const char *sNodeName)=0 |
Find sub-pbject by name. | |
virtual IStatObj::SSubObject * | FindSubObject_CGA (const char *sNodeName)=0 |
Find sub-object by name (including spaces, comma and semi-colon. | |
virtual IStatObj::SSubObject * | FindSubObject_StrStr (const char *sNodeName)=0 |
Find object by full name (use all the characters) | |
virtual bool | RemoveSubObject (int nIndex)=0 |
Remove Sub-Object. | |
virtual bool | CopySubObject (int nToIndex, IStatObj *pFromObj, int nFromIndex)=0 |
Copy Sub-Object. | |
virtual IStatObj::SSubObject & | AddSubObject (IStatObj *pStatObj)=0 |
Adds a new sub object. | |
virtual int | PhysicalizeSubobjects (IPhysicalEntity *pent, const Matrix34 *pMtx, float mass, float density=0.0f, int id0=0, strided_pointer< int > pJointsIdMap=0, const char *szPropsOverride=0, int idbodyArtic=-1)=0 |
Adds subobjects to pent, meshes as parts, joint helpers as breakable joints. | |
virtual int | Physicalize (IPhysicalEntity *pent, pe_geomparams *pgp, int id=-1, const char *szPropsOverride=0)=0 |
virtual bool | IsDeformable ()=0 |
virtual bool | SaveToCGF (const char *sFilename, IChunkFile **pOutChunkFile=NULL, bool bHavePhysicalProxy=false)=0 |
virtual IStatObj * | Clone (bool bCloneGeometry, bool bCloneChildren, bool bMeshesOnly)=0 |
Clones static geometry, Makes an exact copy of the Static object and the contained geometry. | |
virtual int | SetDeformationMorphTarget (IStatObj *pDeformed)=0 |
virtual IStatObj * | DeformMorph (const Vec3 &pt, float r, float strength, IRenderMesh *pWeights=0)=0 |
virtual IStatObj * | HideFoliage ()=0 |
hides all non-physicalized geometry, clones the object if necessary | |
virtual int | Serialize (TSerialize ser)=0 |
Serialize the StatObj's mesh into a stream. | |
virtual const char * | GetProperties ()=0 |
Get object properties as loaded from CGF. | |
virtual void | SetProperties (const char *)=0 |
Update object properties. | |
virtual bool | GetPhysicalProperties (float &mass, float &density)=0 |
Get physical properties specified for object. | |
virtual IStatObj * | GetLastBooleanOp (float &scale)=0 |
Return the last B operand for this object as A, along with its relative scale. | |
virtual bool | RayIntersection (SRayHitInfo &hitInfo, IMaterial *pCustomMtl=0)=0 |
virtual bool | LineSegIntersection (const Lineseg &lineSeg, Vec3 &hitPos, int &surfaceTypeId)=0 |
virtual void | DebugDraw (const struct SGeometryDebugDrawInfo &info)=0 |
virtual void | GetStatistics (SStatistics &stats)=0 |
Fill statistics about the level. | |
virtual hidemask | GetInitialHideMask ()=0 |
Returns initial hide mask. | |
virtual void | SetStreamingDependencyFilePath (const char *szFileName)=0 |
Set the filename of the mesh of the next state (for example damaged version). | |
virtual int | ComputeLodFromScale (float fScale, float fLodRatioNormalized, float fEntDistance, bool bFoliage, bool bForPrecache)=0 |
Expose the computelod function from the engine. | |
virtual SMeshLodInfo | ComputeGeometricMean () const =0 |
virtual float | GetLodDistance () const =0 |
Return the distance for the first LOD switch. Used for brushes and vegetation. | |
virtual Vec3 | GetDepthSortOffset () const =0 |
Return the additional local-space offset used when depth sorting rendered objects. | |
Public Member Functions inherited from IStreamable | |
bool | UpdateStreamingPrioriryLowLevel (float fImportance, int nRoundId, bool bFullUpdate) |
virtual void | StartStreaming (bool bFinishNow, IReadStream_AutoPtr *ppStream)=0 |
virtual int | GetStreamableContentMemoryUsage (bool bJustForDebug=false)=0 |
virtual void | ReleaseStreamableContent ()=0 |
virtual void | GetStreamableName (string &sName)=0 |
virtual uint32 | GetLastDrawMainFrameId ()=0 |
virtual bool | IsUnloadable () const =0 |
Additional Inherited Members | |
Public Attributes inherited from IStreamable | |
SInstancePriorityInfo | m_arrUpdateStreamingPrioriryRoundInfo [2] |
float | fCurImportance |
EFileStreamingStatus | m_eStreamingStatus |
uint32 | m_nSelectedFrameId: 31 |
uint32 | m_nStatsInUse: 1 |
Represents a static object that can be rendered in the scene, represented by the .CGF format.
|
pure virtual |
Copies foliage data to another statobj
pObjDst | Target stat obj. |
bMove | true if the data needs to be removed from the original statobj. |
|
pure virtual |
Create an empty indexed mesh ready to be filled with data. If an indexed mesh already exists it is returned
|
pure virtual |
Debug Draw this static object.
nFlags | - bit0 no culling, bit1 - not draw lines. |
Change the weights of the deformation morphing according to point, radius, and strength. If the object is a compound object, updates the weights of its subobjects that have deformation morphs. Clones the object if necessary, otherwise updates the weights passed as a pWeights param
|
pure virtual |
Returns the filename of the object.
|
pure virtual |
Returns the name of the geometry.
|
pure virtual |
Gets the position of a specified helper. Will return the position of the helper named in the argument. The helper should have been specified during the exporting process of the cgf file.
szHelperName | A null terminated string holding the name of the helper. |
|
pure virtual |
Get the object source geometry. Provide access to the faces, vertices, texture coordinates, normals and colors of the object used later for CRenderMesh construction.
|
inline virtual |
Return a pointer to the object.
|
pure virtual |
Get the LOD object, if present.
nLodLevel | Level of the LOD. |
bReturnNearest | If true will return nearest available LOD to nLodLevel. |
|
pure virtual |
Get the center of bounding box.
|
pure virtual |
Invalidate geometry inside IStatObj, will mark hosted IIndexedMesh as invalid.
bPhysics | If true will also recreate physics for indexed mesh. |
|
pure virtual |
Compares if another object is the same.
szFileName | Filename of the object to compare. |
szGeomName | Geometry name of the object to compare (optional). |
|
pure virtual |
Intersect lineseg with static object. Works on dedi server as well. Lineseg must be in object local space. Returns the hit position and the surface type id of the point hit.
|
pure virtual |
Adds all phys geometries to pent, assigns ids starting from id; takes mass and density from the StatObj properties if not set in pgp. id == -1 means that compound objects will use the 0th level in the id space (i.e. slot#==phys id), and simple objects will let the physics allocate an id for compound objects calls PhysicalizeSubobjects if >=0, idbodyArtic sets it for all parts as idbody, otherwise idbody is set to each node's phys part id
|
pure virtual |
Physicalizes StatObj's foliage Creates a skinnable object instance for foliage simulation
pTrunk | Existing physical entity of the trunk (foliage gets attached to it). |
mtxWorld | Its world matrix. |
pRes | Destination pointer (if the object is deleted after timeouting, it will write 0 there). |
lifeTime | Idle time after which the object gets deleted. |
|
pure virtual |
Intersect ray with static object. Ray must be in object local space.
|
pure virtual |
Reloads one or more component of the object. The possible flags are FRO_SHADERS, FRO_TEXTURES and FRO_GEOMETRY.
nFlags | One or more flag which indicate which element of the object to reload. |
|
pure virtual |
Save contents of static object to the CGF file. Save object to the CGF file.
sFilename |
pOutChunkFile |
|
pure virtual |
Set the minimum bounding box component.
vBBoxMax | Minimum bounding box component. |
|
pure virtual |
Set the minimum bounding box component.
vBBoxMin | Minimum bounding box component. |
|
pure virtual |
Make sure that both objects have one-to-one vertex correspondance. Sets MorphBuddy for this object's render mesh
|
pure virtual |
Set the filename of the object.
szFileName | New filename of the object. |
|
pure virtual |
Set static object flags.
nFlags | Flags to set, a combination of EStaticObjectFlags values. |
|
pure virtual |
Set default material for the geometry.
pMaterial | Valid pointer to the material. |
|
pure virtual |
Set the physics representation. Sets and replaces the physical representation of the object.
pPhysGeom | Pointer to a phys_geometry class. |
nType | Pass 0 to set the physic geometry or pass 1 to set the obstruct geometry. |
Skins vertices based on skeleton vertices (mtxSkelToMesh[pSkelVtx[i]]). Clones the object if necessary to make the modifications
Updates vertices in the range [iVtx0..iVtx0+nVtx-1], vertices are in their original order (as they are physicalized). Clones the object if necessary to make the modifications