[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_Object Library
Object library
Number of functions: 99
HYP_Object.SetPolygonMode
SetPolygonMode allows to choose the plain (SOLID) or WIREFRAME display of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
mode [INTEGER]: POINT (0), LINE (1) or SOLID (2)
:
WIREFRAME = 1;
HYP_Object.SetPolygonMode(id, WIREFRAME);
HYP_Object.GetVectTo
Returns the vector and the distance to another object. Instances are used if instanceIndex1 >= 0 or instanceIndex2 >= 0. This function is based on Based on Blender KX_GameObject.getVectTo(other).
: Lua - Python
id1 [INTEGER]: first object id
id2 [INTEGER]: second object id
instanceIndex1 [INTEGER]: instance index in the first object. Set it to -1 to not use it
instanceIndex2 [INTEGER]: instance index in the second object. Set it to -1 to not use it
distance [REAL]: distance between both objects
globalVec_x, globalVec_y, globalVec_z [REAL]: vector between both objects in world coordinates
localVec_x, localVec_y, localVec_z [REAL]: vector between both objects in first object space
:
distance = HYP_Object.GetVectTo(id1, id2, -1, -1)
HYP_Object.SetPosition
Allows to change the object's position.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
new_x [REAL]: position in X
new_y [REAL]: position in Y
new_z [REAL]: position in Z
:
HYP_Object.SetPosition(object_id, new_x, new_y, new_z)
HYP_Object.GetPosition
Returns the object's position.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x [REAL]: X coordinate of position
y [REAL]: Y coordinate of position
z [REAL]: Z coordinate of position
: x, y, z = HYP_Object.GetPosition( object_id );
HYP_Object.GetAbsolutePosition
GetAbsolutePosition gets the pivot point (or local system center)absolute position.The absolute position is the position relative to the world coordinate system. This function becomes mandatory when operating on hierachies.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x [REAL]: X coordinate
y [REAL]: Y coordinate
z [REAL]: Z coordinate
: x, y, z = HYP_Object.GetAbsolutePosition( object_id );
HYP_Object.SetName
Sets the object's name.
: Lua - Python
object_id [INTEGER]: object numeric identifier
name [STRING]: object's name.
:
HYP_Object.SetName(id, "NewName")
HYP_Object.GetName
Gets the object's name.
: Lua - Python
object_id [INTEGER]: object numeric identifier
name [STRING]: object's name.
:
name = HYP_Object.GetName(id)
HYP_Object.GetId
Gets the numeric identifier from the name of an object.
: Lua - Python
name [STRING]: Object's name as specified in the XML name attribute.
id [INTEGER]: object numeric identifier
:
id = HYP_Object.GetId("object_name")
HYP_Object.SetLightingState
Activates the lighting equations for the object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetLightingState( object_id, state )
HYP_Object.SetFrustumCullingTestState
Enables or disable object culling against camera's frustum.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetFrustumCullingTestState(object_id, state)
HYP_Object.AbsoluteToLocal
AbsoluteToLocal allows to transform a set of absolute coordinates in local coordinates.
: Lua - Python
object_id [INTEGER]: object identifier
abs_x [REAL]: x coordinate in the absolute coordinate system (world system).
abs_y [REAL]: y coordinate in the absolute coordinate system (world system).
abs_z [REAL]: z coordinate in the absolute coordinate system (world system .
loc_x [REAL]: x coordinate in local object coordinate system
loc_y [REAL]: y coordinate in local object coordinate system
loc_z [REAL]: z coordinate in local object coordinate system
:
loc_x, loc_y, loc_z = HYP_Object.AbsoluteToLocal( object_id, abs_x, abs_y, abs_z )
HYP_Object.ClearAllMaterials
ClearAllMaterials cancels all materials from an object. After having called this function your must reassign at least one material or the rendering won't work as expected.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.ClearAllMaterials( object_id )
HYP_Object.SetMaterial
Attaches a material to an object.
It is strongly recommended to call HYP_Object.ClearAllMaterials() first to properly initialize the internal list of materials.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
material_id [INTEGER]: material numeric Identifier
:
HYP_Object.SetMaterial(object_id, material_id)
HYP_Object.SetReflectionState
Adds the object to the reflection engine.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetReflectionState( object_id, state )
HYP_Object.SetRenderState
Activates or desactivates the rendering of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
TRUE = 1;
FALSE = 0;
HYP_Object.SetRenderState(sphereId1, FALSE)
HYP_Object.SetRenderState(sphereId2, TRUE)
HYP_Object.SetTexturingState
Activates or desactivates texturing state for the object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetTexturingState( object_id, state )
HYP_Object.SetVBOState
Activates or desactivates the Vertex Buffer Object (VBO) for a particular mesh or model.
HYP_SetVBOState will take effect only according the hardware capabilities.
You can use GPU Caps viewer (http://www.ozone3d.net/gpu_caps_viewer) to check the GC.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetVBOState( object_id, state )
HYP_Object.SetRenderWithDisplayListState
Activates or desactivates the rendering with OpenGL display lists (mesh / model).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetRenderWithDisplayListState(object_id, state)
HYP_Object.SetNormalizationState
SetNormalizationState activates the autmatic normalization of the object's vertices.
Normalization is often used after a scaling operation on a transform matrix (ScaleObject()function).
Normalization may cause performance slowdown and should be desactivated when no longer needed.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetNormalizationState(object_id, state)
HYP_Object.SetBlendingFactors
Sets the source and destination blending factors applied to an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
source_fac [INTEGER]: BLENDING_FACTOR_ZERO = 0;
BLENDING_FACTOR_ONE = 1;
BLENDING_FACTOR_SRC_ALPHA = 2;
BLENDING_FACTOR_ONE_MINUS_DST_ALPHA = 3;
BLENDING_FACTOR_ONE_MINUS_DST_COLOR = 4;
BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA = 5;
BLENDING_FACTOR_DST_COLOR = 6;
BLENDING_FACTOR_DST_ALPHA = 7;
BLENDING_FACTOR_SRC_COLOR = 8;
BLENDING_FACTOR_ONE_MINUS_SRC_COLOR = 9;
dist_fac [INTEGER]: BLENDING_FACTOR_ZERO = 0;
BLENDING_FACTOR_ONE = 1;
BLENDING_FACTOR_SRC_ALPHA = 2;
BLENDING_FACTOR_ONE_MINUS_DST_ALPHA = 3;
BLENDING_FACTOR_ONE_MINUS_DST_COLOR = 4;
BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA = 5;
BLENDING_FACTOR_DST_COLOR = 6;
BLENDING_FACTOR_DST_ALPHA = 7;
BLENDING_FACTOR_SRC_COLOR = 8;
BLENDING_FACTOR_ONE_MINUS_SRC_COLOR = 9;
:
HYP_Object.SetBlendingFactors(object_id, source_fac, dist_fact)
HYP_Object.SetBlendingState
Sets the blending state of the object colors.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetBlendingState(object_id, state)
HYP_Object.SetOrientation
Sets the tripod orientation (local axis of object).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
angle [REAL]: rotation angle in degrees.
x [REAL]: X coordinate of rotation axis
y [REAL]: Y coordinate of rotation axis
z [REAL]: Z coordinate of rotation axis
pitch [REAL]: rotation angle on X axis
yaw [REAL]: rotation angle on Y axis
roll [REAL]: rotation angle on Z axis
:
HYP_Object.SetOrientation( object_id, angle, x, y, z )
HYP_Object.SetEulerAngles
Sets the tripod orientation with Euler's angles.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
pitch [REAL]: rotation angle on X axis
yaw [REAL]: rotation angle on Y axis
roll [REAL]: rotation angle on Z axis
:
HYP_Object.SetEulerAngles( object_id, pitch, yaw, roll)
HYP_Object.Rotate
Rotates the local object tripod.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
x [REAL]: X component of rotation axis
y [REAL]: Y component of rotation axis
z [REAL]: Z component of rotation axis
transform_space [INTEGER]: 1 :(TRANSFORM_SPACE_PARENT): rotation relative to the parent system;
2 :(TRANSFORM_SPACE_WORLD): rotation relative to the world system;
3 :(TRANSFORM_SPACE_LOCAL): rotation in the object local system
:
HYP_Object.Rotate( object_id, angle, x, y, z, transform_space )
HYP_Object.SetPitch
Rotates the local object tripod around X axis.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
pitch [REAL]: rotation angle on X axis
transform_space [INTEGER]: 1 :(TRANSFORM_SPACE_PARENT): rotation relative to the parent system;
2 :(TRANSFORM_SPACE_WORLD): rotation relative to the world system;
3 :(TRANSFORM_SPACE_LOCAL): rotation in the object local system
[]:
:
HYP_Object.SetPitch( object_id, pitch, transform_space )
HYP_Object.SetYaw
Rotates the local object tripod around Y axis.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
yaw [REAL]: rotation angle on Y axis
transform_space [INTEGER]: 1 :(TRANSFORM_SPACE_PARENT): rotation relative to the parent system;
2 :(TRANSFORM_SPACE_WORLD): rotation relative to the world system;
3 :(TRANSFORM_SPACE_LOCAL): rotation in the object local system
:
HYP_Object.SetYaw( object_id, yaw, transform_space )
HYP_Object.SetRoll
Rotates the local object tripod around Z axis.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
roll [REAL]: rotation angle on Z axis
transform_space [INTEGER]: 1 :(TRANSFORM_SPACE_PARENT): rotation relative to the parent system;
2 :(TRANSFORM_SPACE_WORLD): rotation relative to the world system;
3 :(TRANSFORM_SPACE_LOCAL): rotation in the object local system
:
HYP_Object.SetRoll( object_id, roll, transform_space )
HYP_Object.SetScale
Applies scales factors to the object's internal transform matrix
like HYP_Object.SetPitch()or HYP_Object.SetPosition(). If the object is lighted it is impotant to use HYP_Object.SetNormalizationState() to compute the normals afterward.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
scale_x [REAL]: Scale factor in X
scale_y [REAL]: Scale factor in Y
scale_z [REAL]: Scale factor in Z
[]:
:
HYP_Object.SetScale( mySphere_id, 0.8, 0.8, 0.8 );
HYP_Object.SetNormalizationState(mySphere_id, 1);
HYP_Object.GetSize
Returns the dimensions of the object's bounding box.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
w [REAL]: Width of the bounding box
h [REAL]: Height of the bounding box
d [REAL]: Depth of the bounding box
:
w, h, d = HYP_Object.GetSize( object_id )
HYP_Object.GetBoundingVolumeAbsoluteCenter
Returns the bounding box center absolute position.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x [REAL]: X coordinate
y [REAL]: Y coordinate
z [REAL]: Z coordinate
:
x, y, z = HYP_Object.GetBoundingVolumeAbsoluteCenter( object_id )
HYP_Object.DisplayBoundingVolume
Displays the bounding volume.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
shape [INTEGER]: 1==bounding box and 2==bounding sphere.
state [INTEGER]: 1 activates the display of the bounding volume, 0 desactivates display.
:
HYP_Object.DisplayBoundingVolume(object_id, shape, state)
HYP_Object.GetAbsolute_X_Axis
GetAbsolute_X_Axis gets the X vector from the local center system (object system).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x_axis [REAL]: Unit vector X coordinate along the X axis of scene
y_axis [REAL]: Unit vector Y coordinate along the Y axis of scene
z_axis [REAL]: Unit vector Z coordinate along the Z axis of scene
:
x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_X_Axis( myPlane_id )
HYP_Object.GetAbsolute_Y_Axis
GetAbsolute_Y_Axis gets the Y vector from the local center system (object system).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x_axis [REAL]: Unit vector X coordinate along the X axis of scene
y_axis [REAL]: Unit vector Y coordinate along the Y axis of scene
z_axis [REAL]: Unit vector Z coordinate along the Z axis of scene
:
x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_Y_Axis( object_id )
HYP_Object.GetAbsolute_Z_Axis
GetAbsolute_Z_Axis gets the Z vector from the local center system (object system).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
x_axis [REAL]: Unit vector X coordinate along the X axis of scene
y_axis [REAL]: Unit vector Y coordinate along the Y axis of scene
z_axis [REAL]: Unit vector Z coordinate along the Z axis of scene
:
x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_Z_Axis( myPlan_id )
HYP_Object.SetObjectRelativeTransformMatrix
Sets the local transformation matrix (OpenGL conventions) of an object.
: Lua - Python
id [INTEGER]: object numeric identifier
m0 .. to .. m15 [REAL]: 16 elements of the matrix
:
HYP_Object.SetObjectRelativeTransformMatrix(id, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)
HYP_Object.GetObjectAbsoluteTransformMatrix
Gets the absolute transformation matrix (OpenGL conventions) of an object.
: Lua - Python
id [INTEGER]: object numeric identifier
m0 .. to .. m15 [REAL]: 16 elements of the matrix
:
m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Object.GetObjectAbsoluteTransformMatrix(id)
HYP_Object.ComputeNormals
Computes the vertices normals.
: Lua - Python
object_id [INTEGER]: object numeric identifier
:
HYP_Object.ComputeNormals(object_id)
HYP_Object.ComputeTangentSpace
Computes the normal vectors of the tangent space of each vertex. Useful for bump mapping.
: Lua - Python
object_id [INTEGER]:
NONE []:
:
HYP_Object.ComputeTangentSpace(object_id)
HYP_Object.AverageNormals
AverageNormals computes an average from the vertices normals of an object. Has the same effect as HYP_RemoveSeam()
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.AverageNormals( object_id )
HYP_Object.GetNumMaterials
Returns the number of materials attached to an object.
: Lua - Python
id [INTEGER]: object numeric identifier
n [INTEGER]: number of materials
:
n = HYP_Object.GetNumMaterials(id)
HYP_Object.GetMaterialIndex
Returns the material index in the object materials list.
: Lua - Python
id [INTEGER]: object numeric identifier
materialId [INTEGER]: material numeric identifier
index [INTEGER]: material index
:
index = HYP_Object.GetMaterialIndex(id, materialId)
HYP_Object.FreeAllTextures
Frees all textures of all materials of an object.
: Lua - Python
id [INTEGER]: object numeric identifier
:
HYP_Object.FreeAllTextures(id)
HYP_Object.GetParent
Returns the numeric id of the parent object, or -1 if it fails.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
parent_id [INTEGER]: Parent object numeric Identifier
:
parent_id = HYP_Object.GetParent( object_id )
HYP_Object.GetChild
Gets the child of an object in a parent's hierarchy. With succes returns the child id, or -1 if it fails. This function performs a full search in the hierarchy no matter how deep it is.
: Lua - Python
parent_id [INTEGER]: Parent object numeric identifier.
child_id [INTEGER]: Child object numeric identifier.
id_child [INTEGER]: Child object numeric identifier
:
id_child = HYP_Object.GetChild(parent_id, child_id)
HYP_Object.GetChildByIndex
Gets the direct child of a parent object (first level of hierarchy).With succes returns the child id, or -1 if it fails.
: Lua - Python
parent_id [INTEGER]: Parent object numeric Identifier.
index [INTEGER]: Index of the child in the hierarchy.
id_child [INTEGER]: Child object numeric Identifier
:
function processChildren( parent )
local num_children = HYP_Object.GetNumChildren( parent_id )
local i=0
while(i<num_children) do
id_child = HYP_Object.GetChildByIndex( parent_id, i )
DoSomethingWithChild()
processChildren( id_child )
i = i + 1
end
end
processChildren( "humanModel" )
HYP_Object.IsTypeOf
Returns the type of an object.
: Lua - Python
object_id [INTEGER]: object numeric identifier
type [STRING]: object type. The following types are accepted:
O3_OBJECT_TYPE_CAMERA,
O3_OBJECT_TYPE_FONT,
O3_OBJECT_TYPE_GIZMO,
O3_OBJECT_TYPE_LIGHT,
O3_OBJECT_TYPE_MODEL,
O3_OBJECT_TYPE_MESH,
O3_OBJECT_TYPE_MESH_CYLINDER,
O3_OBJECT_TYPE_MESH_PLANE,
O3_OBJECT_TYPE_MESH_TORUS,
O3_OBJECT_TYPE_MESH_DISC,
O3_OBJECT_TYPE_MESH_TERRAIN,
O3_OBJECT_TYPE_MESH_VB_QUAD,
O3_OBJECT_TYPE_MESH_SPHERE,
O3_OBJECT_TYPE_MESH_BEZIER,
O3_OBJECT_TYPE_MESH_SHOCKWAVE,
O3_OBJECT_TYPE_MESH_BOX,
O3_OBJECT_TYPE_PRIMITIVE,
O3_OBJECT_TYPE_BOX,
O3_OBJECT_TYPE_DISC,
O3_OBJECT_TYPE_LINE,
O3_OBJECT_TYPE_PLANE,
O3_OBJECT_TYPE_QUAD,
O3_OBJECT_TYPE_SPHERE,
O3_OBJECT_TYPE_TRIANGLE,
O3_OBJECT_TYPE_SURFACE,
O3_OBJECT_TYPE_CURVE,
O3_OBJECT_TYPE_SKYBOX,
O3_OBJECT_TYPE_GRID_STRING,
state [INTEGER]: 1 if type or 0 if not.
:
state = HYP_Object.IsTypeOf( object_id, type )
HYP_Object.AddChild
Adds a child object to a parent object.
: Lua - Python
parent_id [INTEGER]: parent Identifier
child_id [INTEGER]: child Identifier
:
HYP_Object.AddChild(parent_id,child_id)
HYP_Object.RemoveChild
Removes a child object from a parent object.
: Lua - Python
parent_id [INTEGER]: parent Identifier
child_id [INTEGER]: child Identifier
:
HYP_Object.RemoveChild(parent_id,child_id)
HYP_Object.Check_AABB_Collision
Check_AABB_Collision checks the collision state of two objects according to their Axis Aligned Bounding Box.Returns 1 for collision, else 0.
: Lua - Python
object_1_id [INTEGER]: object1 numeric Id
object_2_id [INTEGER]: object2 numeric Id
res [INTEGER]: 1 = collision, 0 = no collision.
:
res = HYP_Object.Check_AABB_Collision( object_1_id ,object_2_id )
if(res==1) then
-- Collision: do something...
end
HYP_Object.Check_BS_Collision
Check_BS_Collision checks collision state between two objects according to their respective Bounding Sphere
: Lua - Python
object_1_id [INTEGER]: object1 numeric Identifier
object_2_id [INTEGER]: object2 numeric Identifier
res [INTEGER]: 1 = collision, 0 = no collision.
:
res = HYP_Object.Check_BS_Collision( object_1_id, object_2_id );
if(res==1) then
...
end
HYP_Object.CreateGizmo
Creates a new gizmo.
: Lua - Python
id [INTEGER]: gizmo numeric Identifier
:
id = HYP_Object.CreateGizmo()
HYP_Object.DestroyGizmo
Destroys an existing gizmo
: Lua - Python
id [INTEGER]: gizmo numeric Identifier
:
HYP_Object.DestroyGizmo(id)
HYP_Object.KillAllTextures
Removes and destroys all textures of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
NONE []:
:
HYP_Object.KillAllTextures(object_id)
HYP_Object.RemoveAllTextures
Removes all textures of an object. The textures stay in memory for forcoming use.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
NONE []:
:
HYP_Object.RemoveAllTextures(object_id)
HYP_Object.DisplayTripod
Enables or disables the display of the object's tripod (the local system of an object).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.DisplayTripod(object_id, state)
HYP_Object.GetAbsolutePitch
Gets the current value of angle with the X axis relative to the world coordinate system.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetAbsolutePitch( object_id )
HYP_Object.GetAbsoluteYaw
Gets the current value of angle with the Y axis relative to the world coordinate system.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetAbsoluteYaw( object_id )
HYP_Object.GetAbsoluteRoll
Gets the current value of angle with the Z axis relative to the world coordinate system.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetAbsoluteRoll( object_id )
HYP_Object.GetActiveState
Gets the active state of an object
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: returns 1 for active , 0 for non active.
:
state = HYP_Object.GetActiveState( object_id )
HYP_Object.GetBackFaceCullingState
GetBackFaceCullingState shows if the back faces of polygons are activated for this object.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: returns 1 for active , 0 for non active.
:
state = HYP_Object.GetBackFaceCullingState( object_id )
HYP_Object.GetBlendingState
GetBlendingState shows if the blending state is activated for this object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: returns 1 for active , 0 for non active.
:
state = HYP_Object.GetBlendingState( object_id )
HYP_Object.GetBlendingFactors
GetBlendingFactors gets the source and destinations blending factors for an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
source_factor [INTEGER]: See SetBlendingFactors().
dest_factor [INTEGER]: See SetBlendingFactors().
:
source_factor, dest_factor = HYP_Object.GetBlendingFactors( object_id )
HYP_Object.GetDirection
Returns the object's direction vector. This vector corresponds to the local system Z axis.
: Lua
object_id [INTEGER]: object numeric Identifier
new_x [REAL]: X coordinate of the direction vector
new_y [REAL]: Y coordinate of the direction vector
new_z [REAL]: Z coordinate of the direction vector
:
new_x, new_y, new_z = HYP_Object.GetDirection( object_id )
HYP_Object.GetDistanceBetween
Returns the distance between the tripods of two objects.
: Lua
object_1_id [INTEGER]: object 1 numeric Identifier
object_2_id [INTEGER]: object 2 numeric Identifier
distance [REAL]: Distance in the world unit value.
:
dist = HYP_Object.GetDistanceBetween( fly_camera_id, SphereModel_id );
if dist<200.0 then
-- Do something...
end
HYP_Object.GetLightingState
GetLightingState shows if the lighting equations are computed for this object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: returns 1 for activated , 0 for non activated.
:
state = HYP_Object.GetLightingState( object_id )
HYP_Object.GetNumChildren
Returns the number of direct childs of an object.With succes returns the childs number, or -1 if it fails.
: Lua - Python
parent_id [INTEGER]: Parent object numeric identifier
num_children [INTEGER]: Number of direct childs
:
num_children = HYP_Object.GetNumChildren( parent_id )
HYP_Object.GetPitch
Returns the current angle value around the local system X axis.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetPitch( object_id )
HYP_Object.GetRenderState
Returns the render state of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
TRUE = 1;
FALSE = 0;
if (HYP_Object.GetRenderState(mySphere1_id) == FALSE) then
HYP_Object.SetRenderState(mySphere1_id, TRUE);
end
HYP_Object.GetPickingState
Shows if the picking state of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
state = HYP_Object.GetPickingState( object_id )
HYP_Object.GetRoll
GetRoll returns the current angle value around the local system Z axis.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetRoll( object_id )
HYP_Object.GetTexturingState
GetTexturingState shows if texture application is activated on this object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
state = HYP_Object.GetTexturingState( object_id )
HYP_Object.GetUpdateState
GetUpdateState returns the update state of an object.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
state = HYP_Object.GetUpdateState( object_id )
HYP_Object.GetUpdateTripodDirectionState
GetUpdateTripodDirectionState returns the auto update direction state of the object's tripod.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
state = HYP_Object.GetUpdateTripodDirectionState( object_id )
HYP_Object.GetYaw
GetYaw returns the current angle value around the local system Y axis.
: Lua
object_id [INTEGER]: object numeric Identifier
angle [REAL]: Rotation angle in degrees.
:
angle = HYP_Object.GetYaw( object_id )
HYP_Object.PopTripod
Works in pair with PushTripod(). Restores a tripod previously saved by a call to PushTripod()
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.PopTripod(object_id)
HYP_Object.PushTripod
Pushes (saves) the object's current tripod in a register. A future call to PopTripod() will restore it.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.PushTripod(object_id)
HYP_Object.Render
Performs the rendering of an object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.Render( object_id )
HYP_Object.ApplyRasterizerStatesToRenderer
Applies the rasterizer states (flat or smooth, solid or wireframe, etc...) to the renderer. Useful for mesh instancing or in direct rendering.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.ApplyRasterizerStatesToRenderer(object_id)
HYP_Object.ResetTripod
Resets the tripod of an object.
The tripod is equivalent to the object local system, a data structure storing transformation values for an object.
Reseting a tripod sets the position to <0.0,0.0,0.0> and cancels orientation.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.ResetTripod(object_id)
HYP_Object.SetAlphaMappedState
Adds an object to the special list of objects sorted in camera space before being rendered.
The rendering of this list is performed after the solid object.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: TRUE (1): activated - FALSE (0): non activated
:
HYP_Object.SetAlphaMappedState( object_id, state )
HYP_Object.SetActiveState
Controls the active state of an object. The oZone3D engine
manages 3 fundamental states : ACTIVE, UPDATE and RENDER. The code sample shows that an object with a Render state to FALSE isn't rendered but still updated.
With an Active state on FALSE it won't be rendered nor updated.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
function MainEgineLoop()
do_some_stuffs();
if( object.active_state==TRUE ) then
if( object.update_state==TRUE ) then
object.update();
end
if( object.render_state==TRUE ) then
object.render();
end
end
do_some_stuffs();
end
HYP_Object.SetBackFaceCullingState
Enables or disables the rendering of an object's back faces.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetBackFaceCullingState( object_id, state )
HYP_Object.SetFaceCullingState
Enables or disables face culling.
: Lua - Python
object_id [INTEGER]: object numeric identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetFaceCullingState(object_id, state)
HYP_Object.SetFaceCullingMode
Sets face culling mode: 0 (none), 1 (back), 2 (front), 3 (front and back).
: Lua - Python
object_id [INTEGER]: object numeric Identifier
mode [INTEGER]: face culling mode
:
HYP_Object.SetFaceCullingMode(object_id, 1)
HYP_Object.SetColor
Changes the object's colors.This color is used only wen a lighting is activated.Useful for setting a primitive color.
: Lua
r [REAL]: Red component of the color.
g [REAL]: Green component of the color.
b [REAL]: Blue component of the color.
a [REAL]: Alpha component of the color.
:
HYP_Object.SetColor(object_id, r, g, b, a)
HYP_Object.SetDirection
SetDirection allows to change the direction by chaging the orientation of the object's local system Z axis.
: Lua
object_id [INTEGER]: object numeric Identifier
new_x [REAL]: X coordinate of the direction vector.
new_x [REAL]: X coordinate of the direction vector.
new_x [REAL]: X coordinate of the direction vector.
:
HYP_Object.SetDirection( object_id, new_x, new_y, new_z )
HYP_Object.SetLineWidth
Sets the width parameter for the rendering of a line. Valid when the wireframe rendering is on.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
width [REAL]: Thickness of the line drawn.
:
HYP_Object.SetLineWidth( object_id, width )
HYP_Object.SetPointSize
Sets the size parameter for the rendering of a point. Valid when the point rendering is on.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
pointSize [REAL]: size of the point.
:
HYP_Object.SetPointSize(object_id, pointSize)
HYP_Object.SetPickingState
Activates or desactivates the object's availability for picking operations.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetPickingState( object_id, state )
HYP_Object.SetShadowCasterState
Activates or desactivates volumic shadow projection for the mesh or model object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetShadowCasterState( object_id, state )
HYP_Object.SetUpdateState
Activates or desactivates the update state of an object.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetUpdateState( object_id, state )
HYP_Object.SetUpdateTripodDirectionState
Activates or desactivates the tripod's automatic update direction.
Saves the task of computing the direction vector and the SetDirection().
The tripod's direction is calculated by the difference between current position and position at the previous frame.
: Lua
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: 1 (enabled) or 0 (disabled)
:
HYP_Object.SetUpdateTripodDirectionState( object_id, state )
HYP_Object.Translate
Performs a translation of the object.
: Lua
object_id [INTEGER]: object numeric Identifier
dx [REAL]: translation in X
dy [REAL]: translation in Y
dz [REAL]: translation in Z
transform_space [INTEGER]: 1 :(TRANSFORM_SPACE_PARENT): translation relative to the parent system;
2 :(TRANSFORM_SPACE_WORLD): translation relative to the world system;
3 :(TRANSFORM_SPACE_LOCAL): translation in the object local system
:
HYP_Object.Translate( object_id, dx, dy, dz, transform_space )
HYP_Object.Update
Updates an object.
The update operations are transform matrix updates, normals computing and the internal shader of rendering(lighting, texturing, blending etc..)
: Lua - Python
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.Update(object_id)
HYP_Object.UpdateGeometryData
Allows to update the internal structures of an object after modifications on its geometry.
This function is used for meshes.
: Lua
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.UpdateGeometryData( object_id )
HYP_Object.UpdateTripod
The update of a tripod may be necessary to find the absolute position of an object.The HYP_Object.SetPosition() function modifies only a relative position.
If the object belongs to a complex hierarchy only HYP_Object.GetAbsolutePosition() will give the absolute position.
Usually the tripod is updated every frame but if you're affecting its relative position by a script and need its absolute position a call to UpdateTripod is necessary
: Lua
object_id [INTEGER]: object numeric Identifier
:
HYP_Object.UpdateTripod( object_id )
HYP_Object.SetDrawVertexNormalState
Enables or disables the display of vertices normals. Currently only valid for mesh object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: Enabled (1) or disabled (0)
:
HYP_Object.SetDrawVertexNormalState(meshId, 1)
HYP_Object.GetDrawVertexNormalState
Gets the drawing state of vertices normals. Currently only valid for mesh object.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: Enabled (1) or disabled (0)
:
state = HYP_Object.GetDrawVertexNormalState(meshId)
HYP_Object.SetDrawVertexNormalLengthFactor
Sets the length factor for vertices normals display.
: Lua - Python
object_id [INTEGER]: object numeric Identifier
state [INTEGER]: Enabled (1) or disabled (0)
:
HYP_Object.SetDrawVertexNormalState(meshId, 1)
|