fastest 3D software for linux

Linux 3D
interactive ray-tracing
[1 introduction] [2 overview] [3 reference] [4 GUI]

Index

 E3dScriptFunction_Register
 E3dScriptFunction_Remove
 E3dScriptFunction_ByName
 E3dScene_Init
 E3dScene_New
 E3dScene_CollectNodeNames
 E3d_Init
 E3dScene_NodeHrcAdd
 E3dScene_NodeHrcInsert
 E3dScene_NodeHrcRemove
 E3dScene_MaterialCopy
 E3dScene_ImageLoad
 E3dScene_TextureImageLoad
 E3dScene_NodeHrcReadTextures
 E3dScene_GlobalAnimationAppend
 E3dScene_GlobalAnimationAdd
 E3dScene_GlobalAnimationRemove
 E3dScene_AnimStackAppend
 E3dScene_AnimStackRemove
 E3dScene_AnimationAppend
 E3dScene_AnimationAdd
 E3dScene_AnimationRemove
 E3dScene_GetAnimatedObjects
 E3d_AnimatedObjectsFree
 E3d_ClassToItemID
 E3dObject_Copy
 E3dObject_CopyTo
 E3dObject_UpdateForDisplay
 E3dObject_CustomUpdate
 E3dObject_ComponentsCallUpdate
 E3dSpline_Changed
 E3d_IsObject
 E3dScene_ObjectAnimations
 E3dObject_CollectMaterials
 E3dScene_GetObjects
 E3dScene_GetInstances
 E3dGeometry_GetBoundingBox
 E3dModel_CollectMaterials
 E3dScene_Clear
 E3dScene_RemoveAllCallbacks
 E3dScene_HasSelectedAnimationChannel

E3dScriptFunction_Register

Register a scriptable function

Syntax
int E3dScriptFunction_Register(const char* PName, const char* PUIName, const char* PToolTip, EScriptFunctionFunc PFunc, EResourceList* PParams, EScriptFunction** PFuncStruct)

Arguments
PName Name used for calling the function PUIName Name displayed in a UI PToolTip A description of the function PFunc The implementation (C function to be called) PParams List of parameters PFuncStruct Handle to be returned
Description
Registers a function that can be called from scripts / macros. This allows plugins etc. to register functions that can be called from other plugins.
PParams is shallow-copied, so the caller should not free PParams->Items

Example
// Implementation
static int _Sc_UnifyPolygonDirections(EPointer PParams)
{
  E3dUnifyPolygonDirections*  LParams = (E3dUnifyPolygonDirections*)PParams;if(LParams->Mesh)
  {
    _E3dMesh_FixPolygonDirections(LParams->Mesh, E3d_Scene);
    return(E_SUCCESS);
  }
  else return(E_NO_DATA);
}
typedef struct
{
  E3dMesh*  Mesh;
} E3dUnifyPolygonDirections;
#define ROffset(field)  (void*)(EPtrOffset(E3dUnifyPolygonDirections, field))
static EResource  _UnifyPolygonDirections_ResourcesI[]=
{
  { "Mesh",  EResOBJECT,  ROffset(Mesh) },
};
#undef ROffset
EList_s(static, EResource, _UnifyPolygonDirections_Resources) = { .Items = _UnifyPolygonDirections_ResourcesI, .Count= ECount(_UnifyPolygonDirections_ResourcesI) };
...
static EScriptFunction*  _ScriptFunction = NULL;
...
// Registering
E3dScriptFunction_Register("UnifyPolygonDirections", "Unify Polygon directions", "Make Polygon directions consistent in a Mesh.",  _Sc_UnifyPolygonDirections, &_UnifyPolygonDirections_Resources,  &_ScriptFunction);
...
// Removing
E3dScriptFunction_Remove(_ScriptFunction);_ScriptFunction = NULL;
...
// Calling from C/C++
EScriptFunction*  LFunc = E3dScriptFunction_ByName("UnifyPolygonDirections");if(LFunc) EScriptFunction_Call(LFunc,  "Mesh", PMesh,  NULL);
Return value
E_SUCCESS on success, or E_ALREADY_EXISTS if a function with PName already exists

See also
E3dScriptFunction_ByName, EScriptFunction_Call, E3dScriptFunction_Remove

E3dScriptFunction_Remove

Remove / unregister a ScriptFunction

Syntax
int E3dScriptFunction_Remove(EScriptFunction* PFuncStruct)

Arguments
PFuncStruct Handle returned by E3dScriptFunction_Register()
Description
Un-register a scriptable function.

Return value
E_SUCCESS on success or E_NOT_FOUND

See also
E3dScriptFunction_Register, E3dScriptFunction_ByName, EScriptFunction_Call

E3dScriptFunction_ByName

Find a ScriptFunction by name

Syntax
EScriptFunction* E3dScriptFunction_ByName(const char* PName)

Arguments
PName Name passed to E3dScriptFunction_Register()
Description
Find a ScriptFunction by name and return its handle.

Return value
E_SUCCESS on success or E_NOT_FOUND

E3dScene_Init

Initialize a 3D Scene

Syntax
void E3dScene_Init(E3dScene* PScene)

Argument
PScene Pointer to the Scene structure
Description
This function initializes the given E3dScene structure.

Return value
None.

See also
E3dScene_New, E3dScene_Free

E3dScene_New

Allocate and initialize a 3D Scene

Syntax
E3dScene* E3dScene_New(const char* PName)

Argument
PName The name of the new Scene
Description
This function allocates memory for and initializes an E3dScene structure.

Return value
Pointer to the allocated E3dScene structure or NULL in case of an error.

See also
E3dScene_Free

E3dScene_CollectNodeNames

Collect the names of all Models in a Scene into an array

Syntax
int E3dScene_CollectNodeNames(E3dScene* PScene, char*** PNamesRet)

Arguments
PScene Pointer to the Scene structure PNamesRet Pointer to the array of strings for the return value
Description
This function parses the hierarchies in the given Scene and collects the names of all Models into a dynamically allocated array of strings.

Return value
The number of items in the array (the nuber of Models found).

E3d_Init

Initialize E3D

Syntax
void E3d_Init(void)

Arguments
None.

Description
Initialize libE3D. This function must be called before E3D can be used. It initializes built-in Shader classes, Animation classes, etc.

Return value
None.

E3dScene_NodeHrcAdd

Add a Node-hierarchy to the end of a Scene

Syntax
EBool E3dScene_NodeHrcAdd(E3dScene* PScene, E3dNode* PRootNode, const ECallFlags PCallFlags)

Arguments
PScene Pointer to the Scene structure PRootNode Pointer to the Root node of the hierarchy PCallFlags Flags determining what update procedures to call
Description
Checks if the given hierarchy is in the given Scene. If not, adds to the array: Scene->RootNodes. PCallFlags accepted flags:
E3dCallSCENE_CALLBACKS   Call registered callbacks on the Scene
E3dCallNODE_UPDATEPROCS   Call E3dNodeHrc_CallNodeInfoUpdateProcs for the hierarchy


Return value
None.

See also
E3dScene_NodeHrcRemove

E3dScene_NodeHrcInsert

Add a Node-hierarchy to a Scene before a given position in the list

Syntax
EBool E3dScene_NodeHrcInsert(E3dScene* PScene, E3dNode* PRootNode, const EIndex PWhere, const EBool PNotify)

Arguments
PScene Pointer to the Scene structure PRootNode Pointer to the Root node of the hierarchy PWhere Insert before this index. PNotify If TRUE, call Scene callbacks
Description
Checks if the given hierarchy is in the given Scene. If not, inserts in the array: Scene->RootNodes, before the index "LHere". To add the new Hierarchy to the end, use ELstEND for the index.

Return value
None.

See also
E3dScene_NodeHrcRemove

E3dScene_NodeHrcRemove

Remove Node-hierarchy from a Scene

Syntax
EBool E3dScene_NodeHrcRemove(E3dScene* PScene, E3dNode* PRootNode, EChangeFlags* PChangedRet, const EBool PNotify)

Arguments
PScene Pointer to the Scene structure PRootNode Pointer to the Root of the hierarchy
Description
Checks if the given Hierarchy is in the Scene (it's in RootNodes array of the Scene). If it is, it removes it from that array.

Return value
None.

See also
E3dScene_NodeHrcAdd, E3dScene_NodeHrcInsert

E3dScene_MaterialCopy

Clone a Material

Syntax
E3dMaterial* E3dScene_MaterialCopy(E3dScene* PScene, const E3dRenderer* PRenderer, const E3dMaterial* PMaterial, const EBool PCopyCaches)

Arguments
PMaterial The Material to clone PRenderer Renderer that specifies the color model (EpRGB or EpSPECTRAL) etc. - may be NULL PScene Scene for unique Material names - may be NULL PCopyCaches Copy potentially large caches that would be expensive to recompute (arealight CDF, normalmap etc.)
Description
Creates a duplicate of the given Material. If the PScene argument is not NULL, this function ensures that the name of the new Material will be unique among the Materials in that Scene. For example, if the PMaterial->Name is "Iron" and PScene already has a Material called "Iron", the new Material will be called "Iron-1". If PCopyCaches is TRUE, internal buffers of the Material and its Textures will be copied. This includes textured area-light CDF maps, NormalMaps etc. For example, Materials are copied for a Renderer. This allows the user to safely modify the Scene while the Renderer is running (it's multi-threaded and Equinox3D remains interactive while rendering). Copying a large NormalMap that was generated from a height-map could be a lot faster than regenerating it on the copied Material / Textures. However this may use a lot of memory and it may not be necessary if you just copy a Material for internal use and don't care about those buffers being up-to-date, or if they are cheap to recompute.

Return value
Pointer to the new Material, or NULL in case of an error.

E3dScene_ImageLoad

Read image file

Syntax
int E3dScene_ImageLoad(E3dScene* PScene, const char* PPath, E3dImage** PImageRet)

Arguments
PScene Scene to check if the Image with this file name has been already loaded PPath File path/name PImageRet If not NULL, return a pointer to the new or reused Image
Description
Checks if an Image with the given path/filename exists in PScene. If it does, it simply returns this Image. If the Image is not in the Scene yet, it loads it.

Return value
E_SUCCESS, or an error code if an error occured

E3dScene_TextureImageLoad

Read image file

Syntax
int E3dScene_TextureImageLoad(E3dScene* PScene, E3d2DTexture* PTexture, const char* PPath, const double PFrame, EBool PForceReRead, E3dImage** PImageRet)

Arguments
PScene Scene to check if the Image with this file name has been already loaded PPath File path/name PFrame Frame number, used for numbered image files PTexture Pointer to a Texture PForceReRead If TRUE, reload image, even if PTexture already has it PImageRet If not NULL, return a pointer to the new or reused Image
Description
Checks if an Image with the given path/filename exists in PScene. If it does, and PTexture is NULL, it simply returns this Image. If the Image is not in the Scene yet, it loads it. If PTexture is NULL, it simply loads the Image. This is useful if you want to create the texture only if the Image load was successful. If PTexure is not NULL, it will also assign the Image to PTexure. If PTexture already has this image, but PForceReRead is TRUE, it will reload the Image.

Return value
E_SUCCESS, or an error code if an error occured

E3dScene_NodeHrcReadTextures

(Re)read 2DTexture images for a Model hierarchy

Syntax
EIndex E3dScene_NodeHrcReadTextures(E3dScene* PScene, E3dNode* PRootNode, const char* PPath, const double PFrame)

Argument
PScene Pointer to the Scene PRootNode Pointer to the Root of the hierarchy PForceReRead Re-read images if they are already loaded
Description
This function parses through the given hierarchy and (re)reads the texture images for all the Textures on the Geometries.

Return value
None.

E3dScene_GlobalAnimationAppend

Append a global Animation to a Scene

Syntax
void E3dScene_GlobalAnimationAppend(E3dScene* PScene, E3dAnimation* PAnimation)

Arguments
PScene Pointer to the Scene structure PAnimation Pointer to the new Animation structure
Description
Checks if the given Animation is in the given Scene. If not, adds it to the array: Scene->GlobalAnimations. Global Animations don't belong to a specific AnimStack.

Return value
None.

See also
E3dScene_GlobalAnimationRemove

E3dScene_GlobalAnimationAdd

Create a new Animation and add it to a Scene

Syntax
E3dAnimation* E3dScene_GlobalAnimationAdd(E3dScene* PScene, E3dAnimationClass* PClass)

Arguments
PScene Pointer to the Scene structure PClass Pointer to the Animation class
Description
Creates an Animation of the given Class and adds it to the array: PScene->Animations.

Return value
None.

See also
E3dScene_GlobalAnimationRemove

E3dScene_GlobalAnimationRemove

Remove an Animation from a Scene

Syntax
EBool E3dScene_GlobalAnimationRemove(E3dScene* PScene, E3dAnimation* PAnimation, const EBool PRemoveResidentAnim)

Arguments
PScene Pointer to the Scene structure PAnimation Pointer to the Animation PRemoveResidentAnim Remove Animation, even if it's marked non-Removable
Description
Checks if the given hierarchy is in the Scene (it's in Animations array of the Scene). If it is, it removes it from that array.

Return value
TRUE on success, FALSE if failed (e.g. PAnimation was not in PScene)

See also
E3dScene_GlobalAnimationAdd

E3dScene_AnimStackAppend

Append an AnimStack to a Scene

Syntax
void E3dScene_AnimStackAppend(E3dScene* PScene, E3dAnimStack* PAnimStack)

Arguments
PScene Pointer to the Scene structure PAnimStack Pointer to the new AnimStack structure
Description
Checks if the given AnimStack is in the given Scene. If not, adds it to the first animation stack: Scene->AnimStacks.

Return value
None.

See also
E3dScene_AnimStackRemove

E3dScene_AnimStackRemove

Remove an AnimStack from a Scene

Syntax
void E3dScene_AnimStackRemove(E3dScene* PScene, E3dAnimStack* PAnimStack)

Arguments
PScene Pointer to the Scene structure PAnimStack Pointer to the new AnimStack structure
Description
Checks if the given AnimStack is in the given Scene. If so, it removes it.

Return value
None.

See also
E3dScene_AnimStackAppend

E3dScene_AnimationAppend

Append an Animation to a Scene

Syntax
void E3dScene_AnimationAppend(E3dScene* PScene, E3dAnimation* PAnimation)

Arguments
PScene Pointer to the Scene structure PAnimation Pointer to the new Animation structure
Description
Checks if the given Animation is in the given Scene. If not, adds it to the first animation stack: Scene->CurrentAnimStack. If the Scene has no AnimStacks, it adds a default stack.

Return value
None.

See also
E3dScene_AnimationRemove

E3dScene_AnimationAdd

Allocate and append an Animation to a Scene

Syntax
E3dAnimation* E3dScene_AnimationAdd(E3dScene* PScene, E3dAnimationClass* PClass)

Arguments
PScene Pointer to the Scene structure PAnimation Pointer to the new Animation structure
Description
Allocate an Animation of the given Class, initialize it and add it to the array: Scene->Animations.

Return value
None.

See also
E3dScene_AnimationRemove

E3dScene_AnimationRemove

Remove an Animation from a Scene

Syntax
EBool E3dScene_AnimationRemove(E3dScene* PScene, E3dAnimation* PAnimation, const EBool PRemoveResidentAnim)

Arguments
PScene Pointer to the Scene structure PAnimation Pointer to the Animation PRemoveResidentAnim Remove Animation, even if it's marked non-Removable
Description
Checks if the given hierarchy is in the Scene (it's in Animations array of the Scene). If it is, it removes it from that array.

Return value
TRUE on success, FALSE if failed (e.g. PAnimation was not in PScene)

See also
E3dScene_AnimationAdd

E3dScene_GetAnimatedObjects

Return an array of animated Objects

Syntax
EIndex E3dScene_GetAnimatedObjects(E3dScene* PScene, const uint32_t PObjectTypeFlags, E3dAnimatedObject** PListRet)

Arguments
PScene Pointer to the Scene structure PListRet Pointer in which to return the array
Description
Returns an array of Objects (Models etc.) that have Animation. The caller must free the returned array when it's not used any more.

Return value
The number of animated Objects in PScene.

See also
E3d_AnimatedObjectsFree

E3d_AnimatedObjectsFree

Free an array of animated Objects returned by E3dScene_GetAnimatedObjects

Syntax
void E3d_AnimatedObjectsFree(E3dAnimatedObject* PAO, const EIndex PNAO)

Arguments
PAO Array of E3dAnimatedObject structs PNAO Number of elements in the array
Description
Frees the list, including any dynamically allocated data within the elements.

Return value
None.

See also
E3dScene_GetAnimatedObjects

E3d_ClassToItemID

Convert a Class pointer to an identifier

Syntax
unsigned int E3d_ClassToItemID(const ECoreClass* PClass)

Arguments
PClass Pointer to the Class
Description
Converts a class pointer to an OR-able type quick-identifier flag.

Return value
The ID or 0 if there was no match

E3dObject_Copy

Clone an Object

Syntax
E3dObject* E3dObject_Copy(const E3dObject* PObject, const ECopyFlags PFlags, E3dScene* PScene)

Arguments
PObject Pointer to the E3dObject to be duplicated PFlags Option flags PScene Used for generating unique names.
Description
This function creates an exact duplicate of the given Object by creating a new Object of the same class and calling the constructors and copy-constructors (if any) of the class. The option flags are OR-ed together bits that have the following meaning:
E3dCopyCOMPONENTS   Clone the runtime-typed Component Objects
E3dCopyLODS   Clone Levels of Detail
E3dCopyMATERIALS   Clone Materials (otherwise they will be shared)


Return value
A pointer to the copy, or NULL in case of an error

E3dObject_CopyTo

Clone an Object to an existing Object

Syntax
void E3dObject_CopyTo(const E3dObject* PSrcObject, E3dObject* PNewObject, const ECopyFlags PFlags, E3dScene* PScene)

Arguments
PObject Pointer to the E3dObject to be duplicated PNewObject Pointer to the new E3dObject, to be used as the destination PFlags Option flags
Description
This function creates an exact duplicate of the given Object by calling the constructors and copy-constructors (if any) of the class. The option flags are OR-ed together bits that have the following meaning:
E3dCopyOBJECT_UNIQUE_NAME   Create a unique name for the new Object
E3dCopyCOMPONENTS   Copy the runtime-typed Component Objects
E3dCopyLODS   Copy Levels of Detail
E3dCopyMATERIALS   Copy Materials (otherwise they will be shared)


Return value
A pointer to the copy, or NULL in case of an error

E3dObject_UpdateForDisplay

Update an E3dObject for rendering

Syntax
EChangeFlags E3dObject_UpdateForDisplay(E3dObject* PObject, const EUpdateFlags PUpdateFlags, const ECallFlags PCallFlags, E3dScene* PScene)

Arguments
PObject Pointer to the E3dObject PUpdateFlags Flags indicating what needs to be updated PScene If not NULL the appropriate call-backs of this Scene will be called
Description
Creates / updates rendering information for the given E3dObject by calling its UpdateForDisplay() member function. Such data includes GPU vertex arrays for Meshes, Spline and Face tesselation information etc. Calling this function for an E3dObject after change, with only the necessary flags set, helps E3D greatly improve performance by only updating things that really changed. For example, if the position of a few Vertices changed in a Mesh, use the E3dUpdateMeshSHAPE flag.

Return value
Flags of changes triggered by the update, as returned by the Object's output handlers. For example, updating a Spline that is used as a Revolve profile will cause the E3dChgMeshSHAPE flag to be set in the return value.

See also
E3dObject_FreeRenderData

E3dObject_CustomUpdate

Create/update an Object with the specified runtime-class component

Syntax
E3dObject* E3dObject_CustomUpdate(E3dObject* PObject, void* PObjectComponentTemplate, const ECallFlags PCallFlags, EChangeFlags* PTriggeredChangeFlags)

Arguments
PObject Object to update PObjectComponentTemplate Component template that specifies the values PUpdateFlags Or-ed flags indicating what changed PCallFlags Or-ed flags indicating what callbacks to call (E3dCallOUTPUTS, E3dCallCHANGEPROCS) PTriggeredChangeFlagsP Flags for triggered changes will be returned here
Description
Calls the Update() method of PObjectComponentTemplate->Class. Then, it calls E3dObject_UpdateForDisplay() with PUpdateFlags and PCallFlags.

Return value
PObject, or a pointer to the new Object if one was created.

See also
E3dModel_CustomObjectNew, E3dModel_CustomObjectNewInit

E3dObject_ComponentsCallUpdate

Create/update an Object with the specified runtime-class component

Syntax
EChangeFlags E3dObject_ComponentsCallUpdate(E3dObject* PObject, ECallFlags PCallFlags, EChangeFlags* PTriggeredChangeFlagsP)

Arguments
PObject Object to update PCallFlags Or-ed flags indicating what callbacks to call (E3dCallOUTPUTS, E3dCallCHANGEPROCS)
Description
Calls the Update method of each ObjectComponent on PObject. Then, it calls E3dObject_UpdateForDisplay() with the UpdateFlags returned by those methods, and PCallFlags.

Return value
Change flags (E3dChg*) triggered by the updates.

See also
E3dObject_CustomUpdate

E3dSpline_Changed

Indicate to any Faces using a Spline that they need to be updated

Syntax
EChangeFlags E3dSpline_Changed(E3dSpline* PSpline, const EChangeFlags PChangeFlags, EOpNodeListA* POpNodes)

Arguments
PSpline The Spline PChangeFlags OR-ed E3dChg* flags such as E3dChgSplineSHAPE POpNodesP Operator list for undo/redo
Description
This function should be called for Splines that are used in Faces, when the Spline changes.

Return value
OR-ed flags to indicate any triggered changes, such as E3dChgFACE

E3d_IsObject

Check if a pointer points to an Object

Syntax
EBool E3d_IsObject(ECoreObject* PObject)

Argument
PScene Pointer to the Scene structure
Description
Checks all classes known to E3D (based on EObject), to see if PObject belongs to any of them.

Return value
TRUE, if PObject is an Object, FALSE otherwise

E3dScene_ObjectAnimations

Check if an object is Animated / return the list of Animations that target this Object

Syntax
EIndex E3dScene_ObjectAnimations(E3dScene* PScene, ECoreObject* PObject, const E3dAnimationClass* PAnimationClass, E3dAnimation*** PAnimations)

Argument
PScene Pointer to the Scene PObject Pointer to the object PAnimationClass If not NULL, only consider Animations of this class PAnimations If not NULL, return the list of Animations
Description
Walks through PScene->AnimationStacks and checks if any Channels of those Animations specifies PObject as its TargetObject or TargetSubObject.

Return value
The number of Animations that target this Object.

E3dObject_CollectMaterials

Collect Materials from an Object

Syntax
void E3dObject_CollectMaterials(E3dObject* PObject, E3dMaterialPtrListA* PMaterials)

Arguments
PObject The E3dObject PMaterials Array for the result
Description
Collects Materials used on E3dObject (Mesh, Face etc.). The list must be initialized by the caller, and this function may be called, to collect Materials from multiple Objects.

Return value
None.

See also
E3dNodeHrc_CollectMaterials

E3dScene_GetObjects

Collect Objects in a Scene

Syntax
EIndex E3dScene_GetObjects(E3dScene* PScene, const uint32_t PObjectTypeFlags, const E3dItemFlags PFlags, const EBool PAddReferences, E3dObjectPtrListA* PObjects)

Arguments
PScene Pointer to the Scene structure PObjectTypeFlags Object types to look for. OR-ed flags of E3dItemLIGHT, E3dItemSPLINE, E3dItemMESH etc., or E3dItemALL PFlags Flags, describing the operation, OR-ed flags E3dVISIBLE, E3dHIDDEN, E3dSELECTED, E3dUNSELECTED and E3dEXCLUDE_MODEL_SELECTION PAddReferences Create references to the collected Nodes PObjects Pointer to the list to return the Object pointers
Description
Parses the hierarchies in the given Scene and collects the Objects into an array of pointers. This array must be freed by the application after use. If PAddReferences is TRUE, the Objects will be reference-tracked in the array, so they won't be physically deleted elsewhere. In this case you should call ELst_ObjectsFree() on the array (vs ELst_PointersFree or EFree), or E_Delete on individual entries in the array. If PObjects is NULL, this function simply returns the number of matching Objects found. This example collects all selected Meshes: EListA_s(, E3dObjectPtr, LObjects);LNumOfObjects = E3dScene_GetObjects(MyScene, E3dItemMESH, E3dSELECTED, FALSE, &LObjects); Where LObjects is the type of E3dObject** This example collects all the Objects, regardless of their type, or wheter they are selected or not: EListA_s(, E3dObjectPtr, LObjects);const EIndex LNumOfObjects = E3dScene_GetObjects(MyScene, E3dItemALL, E3dSELECTED|E3dUNSELECTED, TRUE, &LObjects);

Return value
The number of E3dObject pointers in the array (the number of matching Objects found).

E3dScene_GetInstances

Collect Object instances in a Scene

Syntax
EIndex E3dScene_GetInstances(E3dScene* PScene, const uint32_t PObjectTypeFlags, const E3dItemFlags PFlags, const EBool PAddReferences, E3dObjectInstancePtrListA* PInstances)

Arguments
PScene Pointer to the Scene structure PInstances Pointer to the array of Insntance pointers to be returned PObjectTypeFlags Object types to look for. OR-ed flags of E3dItemLIGHT etc., or E3dItemALL PFlags Flags, describing the operation, OR-ed flags E3dVISIBLE, E3dHIDDEN, E3dSELECTED, E3dUNSELECTED and E3dEXCLUDE_MODEL_SELECTION PAddReferences Create references to the collected Nodes
Description
Parses the hierarchies in the given Scene and collects the Objects into an array of pointers. This array must be freed by the application after use. If PAddReferences is TRUE, the Objects will be reference-tracked in the array, so they won't be physically deleted elsewhere. In this case you should call ELst_ObjectsFree() on the array (vs ELst_PointersFree or EFree), or E_Delete on individual entries in the array. If PObjects is NULL, this function simply returns the number of matching Objects found. This example collects all selected Meshes: LNumOfObjects = E3dScene_GetObjects(MyScene, E3dItemMESH, E3dSELECTED, FALSE, &LObjects); Where LObjects is the type of E3dObject** This example collects all the Objects, regardless of their type, or wheter they are selected or not: LNumOfObjects = E3dScene_GetObjects(MyScene, &LObjects, E3dItemALL, E3dSELECTED|E3dUNSELECTED, TRUE, &LObjects);

Return value
The number of E3dObject pointers in the array (the number of matching Objects found).

E3dGeometry_GetBoundingBox

Get the local bounding box of a Geometry

Syntax
EBool E3dGeometry_GetBoundingBox(E3dGeometry* PGeometry, const uint32_t PWhatToInclude, E3dBBox* PBBox)

Arguments
PGeometry Pointer to the Geometry PWhatToInclude OR-ed flags of PBBMox Returned bounding box
Description
Returns the bounding box of the given Geometry. If PWhatToInclude == E3dBB_ALL and PGeometry->BBoxUptodate is TRUE, the bounding box not will be recomputed, but PGeometry->BBox will be returned instead. Accepted flags in PWhatToInclude are: E3dBB_SELECTED_GEOMETRY E3dBB_SHADOW_CASTERS E3dBB_SHADOW_RECEIVERS E3dBB_ALL

Return value
TRUE if successful, FALSE in case of an error, such as the Mesh having no Vertices.

E3dModel_CollectMaterials

Collect Materials used in a Model

Syntax
void E3dModel_CollectMaterials(E3dModel* PModel, E3dMaterialPtrListA* PMaterials)

Arguments
PModel Pointer to the Model PNumOfMaterialsPtr Pointer to the number of Materials found
Description
Collects Materials used by PModel.

Return value
An array of pointers to the Materials found, or NULL. The number is returned in PNumOfMaterialsPtr

E3dScene_Clear

Free the contents of a Scene

Syntax
void E3dScene_Clear(E3dScene* PScene, const EBool PRemoveCameras, const EBool PRemoveResidentAnims)

Arguments
PScene Pointer to the Scene PRemoveCameras If TRUE, remove Cameras and their Nodes as well PRemoveResidentAnims Force-remove any resident Animations
Description
Makes a Scene empty

Return value
None.

See also
E3dScene_Free

E3dScene_RemoveAllCallbacks

Remove all callbacks from a Scene

Syntax
void E3dScene_RemoveAllCallbacks(E3dScene* PScene)

Argument
PScene Pointer to the Scene structure
Description
Removes all call-backs from a Scene.

Return value
None.

See also
E3dScene_CallbackAdd

E3dScene_HasSelectedAnimationChannel

Check if a Scene contains a KeyFrameAnimation with a selected Channel

Syntax
EBool E3dScene_HasSelectedAnimationChannel(const E3dScene* PScene)

Arguments
PScene Pointer to the E3dScene structure
Description
Checks whether a Scene contains a KeyFrameAnimation with a selected Channel.

Return value
TRUE, if a Scene contains a KeyFrameAnimation with a selected Channel, otherwise FALSE.
© 1996-2024 By Gabor Nagy