fastest 3D software for linux

Linux 3D
interactive ray-tracing

Index

 E3d_SceneInit
 E3d_SceneNew
 E3d_SceneCollectNodeNames
 E3d_Init
 E3d_SceneNodeHrcAdd
 E3d_SceneNodeHrcInsert
 E3d_SceneNodeHrcRemove
 E3d_SceneMaterialCopy
 E3d_SceneNodeHrcReadTextures
 E3d_SceneAnimationAppend
 E3d_SceneAnimationAdd
 E3d_SceneAnimationRemove
 E3d_SceneGetAnimatedObjects
 E3d_AnimatedObjectsFree
 E3d_ClassToItemID
 E3d_ObjectCopy
 E3d_ObjectCopyTo
 E3d_ObjectUpdateForDisplay
 E3d_IsObject
 E3d_SceneObjectIsAnimated
 E3d_SceneGetObjects
 E3d_SceneGetInstances
 E3d_ModelCollectMaterials
 E3d_SceneClear
 E3d_SceneRemoveAllCallbacks


E3d_SceneInit

Initialize a 3D Scene

Syntax
void E3d_SceneInit(E3dScene* PScene)

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

Return value
None.

See also
E3d_SceneNew, E3d_SceneFree

E3d_SceneNew

Allocate and initialize a 3D Scene

Syntax
E3dScene* E3d_SceneNew(const char* PName)

Argument
const char* 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
E3d_SceneFree

E3d_SceneCollectNodeNames

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

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

Arguments
E3dScene* PScene Pointer to the Scene structure char*** 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.

E3d_SceneNodeHrcAdd

Add a Node-hierarchy to the end of a Scene

Syntax
EBool E3d_SceneNodeHrcAdd(E3dScene* PScene, E3dNode* PRootNode, const EUpdateFlags PNotifyFlags)

Arguments
E3dScene* PScene Pointer to the Scene structure E3dNode* PRootNode Pointer to the Root node of the hierarchy const EUpdateFlags PNotifyFlags 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. PNotifyFlags accepted flags: E3dUF_CALL_SCENE_CALLBACKS Call retistered callbacks on the Scene E3dUF_CALL_NODE_UPDATEPROCS E3d_NodeHrcCallNodeInfoUpdateProcs for the hierarchy

Return value
None.

See also
E3d_SceneNodeHrcRemove

E3d_SceneNodeHrcInsert

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

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

Arguments
E3dScene* PScene Pointer to the Scene structure E3dNode* PRootNode Pointer to the Root node of the hierarchy const EIndex PWhere Insert before this index. const EBool 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
E3d_SceneNodeHrcRemove

E3d_SceneNodeHrcRemove

Remove Node-hierarchy from a Scene

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

Arguments
E3dScene* PScene Pointer to the Scene structure E3dNode* 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
E3d_SceneNodeHrcAdd, E3d_SceneNodeHrcInsert

E3d_SceneMaterialCopy

Clone a Material

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

Arguments
const E3dMaterial* PMaterial The Material to clone const E3dRenderer* PRenderer Renderer that specifies the color model (EpRGB or EpSPECTRAL) etc. - may be NULL E3dScene* PScene Scene for unique Material names - may be NULL const EBool PCopyCaches Copy potentially large caches
Description
Creates a duplicate of the given Material. If the PScene argument is not NULL, this function makes sure that the name of the new Material will be unique among the Materials in that Scene. For example, if the name of PMaterial is "Iron" and PScene already has a Material called "Iron", the new Material will be called "Iron-1". If PCopyCaches is TRUE, this function will copy internal buffers of the Material and its Textures. This may use a lot of memory and it may not be necessary, if you are just copying a Material to change it, as these buffers will have to be re-generated when you modify the Material or its Textures. It may, hovever save a lot of computation, if the Material is just cloned for safety, for example when a renderer is started. In that case, this copying allows the user to safely modify the Scene while the renderer is running (it's multi-threaded and EQX remains interactive while rendering).

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

E3d_SceneNodeHrcReadTextures

(Re)read 2DTexture images for a Model hierarchy

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

Argument
E3dScene* PScene Pointer to the Scene E3dNode* 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.

E3d_SceneAnimationAppend

Append an Animation to a Scene

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

Arguments
E3dScene* PScene Pointer to the Scene structure E3dAnimation* 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->Animations.

Return value
None.

See also
E3d_SceneAnimationRemove

E3d_SceneAnimationAdd

Allocate and append an Animation to a Scene

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

Arguments
E3dScene* 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
E3d_SceneAnimationRemove

E3d_SceneAnimationRemove

Remove an Animation from a Scene

Syntax
EBool E3d_SceneAnimationRemove(E3dScene* PScene, E3dAnimation* PAnimation)

Arguments
E3dScene* PScene Pointer to the Scene structure E3dAnimation* PAnimation Pointer to the Root of the hierarchy
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
E3d_SceneAnimationAdd

E3d_SceneGetAnimatedObjects

Return an array of animated Objects

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

Arguments
E3dScene* PScene Pointer to the Scene structure E3dAnimatedObject** 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 E3d_SceneGetAnimatedObjects

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

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

Return value
None.

See also
E3d_SceneGetAnimatedObjects

E3d_ClassToItemID

Convert a Class pointer to an identifier

Syntax
unsigned int E3d_ClassToItemID(EObjectClass* PClass)

Arguments
EObjectClass* 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

E3d_ObjectCopy

Clone an Object

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

Arguments
const E3dObject* PObject Pointer to the E3dObject to be duplicated const ECopyFlags PFlags Option flags E3dScene* 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

E3d_ObjectCopyTo

Clone an Object to an existing Object

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

Arguments
PObject Pointer to the E3dObject to be duplicated E3dObject* PNewObject Pointer to the new E3dObject, to be used as the destination const ECopyFlags 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

E3d_ObjectUpdateForDisplay

Update an E3dObject for rendering

Syntax
EChangeFlags E3d_ObjectUpdateForDisplay(E3dObject* PObject, const EUpdateFlags PUpdateFlags, E3dScene* PScene)

Arguments
E3dObject* PObject Pointer to the E3dObject const EUpdateFlags PUpdateFlags Flags indicating what needs to be updated E3dScene* 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 OpenGL vertex arrays for Meshes, Spline and Face tesselation information etc. If PUpdateFlags contains any flags of E3duf_SHAPE, this function will also call the outputs of the Object (if it's a Geometry), as well as any callbacks attached to the main Scene, with the reason: E3dCR_GEOMETRY_CHANGED. 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 E3duf_SHAPE flag bit.

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
E3d_ObjectFreeRenderData

E3d_IsObject

Check if a pointer points to an Object

Syntax
EBool E3d_IsObject(EObject* 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

E3d_SceneObjectIsAnimated

Check if an object is animated

Syntax
EBool E3d_SceneObjectIsAnimated(E3dScene* PScene, EObject* PObject)

Argument
E3dScene* PScene Pointer to the Scene EObject* PObject Pointer to the object
Description
Walks through PScene->Animations and checks if any Channels of those Animations specifies PObject as its TargetObject or TargetSubObject.

Return value
TRUE if an Animation targetting PObject was found, FALSE otherwise.

E3d_SceneGetObjects

Collect Objects in a Scene

Syntax
EIndex E3d_SceneGetObjects(E3dScene* PScene, E3dObject*** PObjects, const int PObjTypes, const E3dItemFlags PFlags, const EBool PAddReferences)

Arguments
E3dScene* PScene Pointer to the Scene structure E3dObject*** PObjects Pointer to the array of Object pointers to be returned const int PObjTypes Object types to look for. OR-ed flags of E3dItemLIGHT etc., or E3dItemANY const E3dItemFlags PFlags Flags, describing the operation, OR-ed flags E3dVISIBLE, E3dHIDDEN, E3dSELECTED, E3dUNSELECTED and E3dEXCLUDE_MODEL_SELECTION const EBool 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 = E3d_SceneGetObjects(MyScene, &LObjects, E3dItemMESH, E3dSELECTED, FALSE); 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 = E3d_SceneGetObjects(MyScene, &LObjects, E3dItemANY, E3dSELECTED|E3dUNSELECTED, TRUE);

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

E3d_SceneGetInstances

Collect Object instances in a Scene

Syntax
EIndex E3d_SceneGetInstances(E3dScene* PScene, E3dInstance*** PInstances, const int PObjTypes, const E3dItemFlags PFlags, const EBool PAddReferences)

Arguments
E3dScene* PScene Pointer to the Scene structure E3dInstance*** PInstances Pointer to the array of Insntance pointers to be returned const int PObjTypes Object types to look for. OR-ed flags of E3dItemLIGHT etc., or E3dItemANY const E3dItemFlags PFlags Flags, describing the operation, OR-ed flags E3dVISIBLE, E3dHIDDEN, E3dSELECTED, E3dUNSELECTED and E3dEXCLUDE_MODEL_SELECTION const EBool 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 = E3d_SceneGetObjects(MyScene, &LObjects, E3dItemMESH, E3dSELECTED, FALSE); 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 = E3d_SceneGetObjects(MyScene, &LObjects, E3dItemANY, E3dSELECTED|E3dUNSELECTED, TRUE);

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

E3d_ModelCollectMaterials

Collect Materials used in a Model

Syntax
E3dMaterial** E3d_ModelCollectMaterials(E3dModel* PModel, EIndex* PNumOfMaterialsPtr)

Arguments
E3dModel* PModel Pointer to the Model EIndex* 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

E3d_SceneClear

Free the contents of a Scene

Syntax
void E3d_SceneClear(E3dScene* PScene, const EBool PAll)

Arguments
E3dScene* PScene Pointer to the Scene const EBool PAll If TRUE, remove Cameras and their Nodes as well
Description
Makes a Scene empty

Return value
None.

See also
E3d_SceneFree

E3d_SceneRemoveAllCallbacks

Remove all callbacks from a Scene

Syntax
void E3d_SceneRemoveAllCallbacks(E3dScene* PScene)

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

Return value
None.

See also
E3d_SceneCallbackAdd
© 1992-2017 By Gabor Nagy