Returns entity type as string (Mesh, Camera, Light, Pivot, Sprite, Unknown).
Takes entity (entity handle).
Returns class name as String ("Mesh", "Camera", "Light", "Pivot", "Sprite" for billboard, "Unknown" for unrecognized type, "" for invalid entity).
3D Graphics
Parameters & Returns
Parameters
entityInt
Returns
String
Quick Summary
Returns entity type as string (Mesh, Camera, Light, Pivot, Sprite, Unknown).
Takes entity (entity handle).
Returns class name as String ("Mesh", "Camera", "Light", "Pivot", "Sprite" for billboard, "Unknown" for unrecognized type, "" for invalid entity).
Technical Exegesis...
Returns entity type as string (Mesh, Camera, Light, Pivot, Sprite, Unknown). Takes entity (entity handle). Returns class name as String ("Mesh", "Camera", "Light", "Pivot", "Sprite" for billboard, "Unknown" for unrecognized type, "" for invalid entity). Validates entity exists, switches on entity.type enum, returns corresponding class name string. Type identification for runtime polymorphism.
This function queries entity type. Entity types: entities have type field (entity.
Returns entity type as string (Mesh, Camera, Light, Pivot, Sprite, Unknown). Takes entity (entity handle). Returns class name as String ("Mesh", "Camera", "Light", "Pivot", "Sprite" for billboard, "Unknown" for unrecognized type, "" for invalid entity). Validates entity exists, switches on entity.type enum, returns corresponding class name string. Type identification for runtime polymorphism.
This function queries entity type. Entity types: entities have type field (entity.type, ENTITY_MESH/CAMERA/LIGHT/PIVOT/BILLBOARD enum), b3dEntityClass converts type enum to human-readable string. Return values: "Mesh" for ENTITY_MESH (3D models, procedural meshes, loaded GLB files), "Camera" for ENTITY_CAMERA (perspective/orthographic cameras), "Light" for ENTITY_LIGHT (directional/point/spot lights), "Pivot" for ENTITY_PIVOT (empty transform nodes, scene organization), "Sprite" for ENTITY_BILLBOARD (always-face-camera quads, particles, UI), "Unknown" for unrecognized type (future entity types, corrupted data), "" empty string for invalid entity handle (entity doesn't exist). Use cases: (1) Type checking (verify entity is expected type before type-specific operations), (2) Debugging (log entity type in error messages, display in inspector), (3) Polymorphism (handle different entity types with different logic), (4) Filtering (iterate entities, process only specific types), (5) Serialization (save entity type for correct deserialization). Common pattern: if b3dEntityClass(entity) == "Mesh": process mesh-specific data, or type = b3dEntityClass(entity), select case type: case "Camera": setup camera. Typical usage: verify type before operations (ensure entity is mesh before accessing mesh data, check if camera before setting FOV), or filter entities by type (find all lights in scene, collect all meshes for batch operations). Type-specific functions: some functions only valid for specific types (b3dCameraFOV only for cameras, b3dEntityTexture only for meshes, b3dLightColor only for lights), checking type prevents invalid operations. Sprite vs Billboard: ENTITY_BILLBOARD returns "Sprite" (legacy Blitz3D terminology, billboard entities are sprites that face camera, 2D images in 3D space). Empty vs Unknown: "" (empty string) means invalid entity handle (entity doesn't exist in g_entities map), "Unknown" means valid entity with unrecognized type (shouldn't occur in normal usage, indicates error or future type). Performance: O(1) lookup (hash map find, switch statement, string literal return), no string allocation (returns static string literals, very fast). Type safety: BambooBasic is dynamically typed (handles are integers, no compile-time type checking), b3dEntityClass provides runtime type identification. Related: entity.type field stores enum, entity creation functions set type (b3dLoadMesh sets ENTITY_MESH, b3dCreateCamera sets ENTITY_CAMERA, etc.), b3dGetEntityName for name identification.