"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

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


Description
Object library

Number of functions: 99

HYP_Object.SetPolygonMode

Description
SetPolygonMode allows to choose the plain (SOLID) or WIREFRAME display of an object.

Languages: Lua - Python

Parameters
  • object_id [INTEGER]: object numeric Identifier
  • mode [INTEGER]: POINT (0), LINE (1) or SOLID (2)

    Code sample :

    WIREFRAME = 1;
    HYP_Object.SetPolygonMode(id, WIREFRAME);


    HYP_Object.GetVectTo

    Description
    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).

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • 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

    Code sample :

    distance = HYP_Object.GetVectTo(id1, id2, -1, -1)


    HYP_Object.SetPosition

    Description
    Allows to change the object's position.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • new_x [REAL]: position in X
  • new_y [REAL]: position in Y
  • new_z [REAL]: position in Z

    Code sample :

    HYP_Object.SetPosition(object_id, new_x, new_y, new_z)


    HYP_Object.GetPosition

    Description
    Returns the object's position.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • x [REAL]: X coordinate of position
  • y [REAL]: Y coordinate of position
  • z [REAL]: Z coordinate of position

    Code sample :
    x, y, z = HYP_Object.GetPosition( object_id );


    HYP_Object.GetAbsolutePosition

    Description
    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.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • x [REAL]: X coordinate
  • y [REAL]: Y coordinate
  • z [REAL]: Z coordinate

    Code sample :
    x, y, z = HYP_Object.GetAbsolutePosition( object_id );


    HYP_Object.SetName

    Description
    Sets the object's name.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric identifier
  • name [STRING]: object's name.

    Code sample :

    HYP_Object.SetName(id, "NewName")


    HYP_Object.GetName

    Description
    Gets the object's name.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric identifier
  • name [STRING]: object's name.

    Code sample :

    name = HYP_Object.GetName(id)


    HYP_Object.GetId

    Description
    Gets the numeric identifier from the name of an object.

    Languages: Lua - Python

    Parameters
  • name [STRING]: Object's name as specified in the XML name attribute.

    Return Values
  • id [INTEGER]: object numeric identifier

    Code sample :

    id = HYP_Object.GetId("object_name")


    HYP_Object.SetLightingState

    Description
    Activates the lighting equations for the object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetLightingState( object_id, state )


    HYP_Object.SetFrustumCullingTestState

    Description
    Enables or disable object culling against camera's frustum.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetFrustumCullingTestState(object_id, state)


    HYP_Object.AbsoluteToLocal

    Description
    AbsoluteToLocal allows to transform a set of absolute coordinates in local coordinates.

    Languages: Lua - Python

    Parameters
  • 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 .

    Return Values
  • 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

    Code sample :

    loc_x, loc_y, loc_z = HYP_Object.AbsoluteToLocal( object_id, abs_x, abs_y, abs_z )


    HYP_Object.ClearAllMaterials

    Description
    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.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.ClearAllMaterials( object_id )


    HYP_Object.SetMaterial

    Description
    Attaches a material to an object. It is strongly recommended to call HYP_Object.ClearAllMaterials() first to properly initialize the internal list of materials.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • material_id [INTEGER]: material numeric Identifier

    Code sample :

    HYP_Object.SetMaterial(object_id, material_id)


    HYP_Object.SetReflectionState

    Description
    Adds the object to the reflection engine.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetReflectionState( object_id, state )


    HYP_Object.SetRenderState

    Description
    Activates or desactivates the rendering of an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    TRUE = 1;
    FALSE = 0;
    HYP_Object.SetRenderState(sphereId1, FALSE)
    HYP_Object.SetRenderState(sphereId2, TRUE)


    HYP_Object.SetTexturingState

    Description
    Activates or desactivates texturing state for the object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetTexturingState( object_id, state )


    HYP_Object.SetVBOState

    Description
    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.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetVBOState( object_id, state )


    HYP_Object.SetRenderWithDisplayListState

    Description
    Activates or desactivates the rendering with OpenGL display lists (mesh / model).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetRenderWithDisplayListState(object_id, state)


    HYP_Object.SetNormalizationState

    Description
    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.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetNormalizationState(object_id, state)


    HYP_Object.SetBlendingFactors

    Description
    Sets the source and destination blending factors applied to an object.

    Languages: Lua - Python

    Parameters
  • 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;

    Code sample :

    HYP_Object.SetBlendingFactors(object_id, source_fac, dist_fact)


    HYP_Object.SetBlendingState

    Description
    Sets the blending state of the object colors.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetBlendingState(object_id, state)


    HYP_Object.SetOrientation

    Description
    Sets the tripod orientation (local axis of object).

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Object.SetOrientation( object_id, angle, x, y, z )


    HYP_Object.SetEulerAngles

    Description
    Sets the tripod orientation with Euler's angles.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Object.SetEulerAngles( object_id, pitch, yaw, roll)


    HYP_Object.Rotate

    Description
    Rotates the local object tripod.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Object.Rotate( object_id, angle, x, y, z, transform_space )


    HYP_Object.SetPitch

    Description
    Rotates the local object tripod around X axis.

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • []:

    Code sample :

    HYP_Object.SetPitch( object_id, pitch, transform_space )


    HYP_Object.SetYaw

    Description
    Rotates the local object tripod around Y axis.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Object.SetYaw( object_id, yaw, transform_space )


    HYP_Object.SetRoll

    Description
    Rotates the local object tripod around Z axis.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_Object.SetRoll( object_id, roll, transform_space )


    HYP_Object.SetScale

    Description
    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.

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • []:

    Code sample :

    HYP_Object.SetScale( mySphere_id, 0.8, 0.8, 0.8 );
    HYP_Object.SetNormalizationState(mySphere_id, 1);


    HYP_Object.GetSize

    Description
    Returns the dimensions of the object's bounding box.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • w [REAL]: Width of the bounding box
  • h [REAL]: Height of the bounding box
  • d [REAL]: Depth of the bounding box

    Code sample :

    w, h, d = HYP_Object.GetSize( object_id )


    HYP_Object.GetBoundingVolumeAbsoluteCenter

    Description
    Returns the bounding box center absolute position.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • x [REAL]: X coordinate
  • y [REAL]: Y coordinate
  • z [REAL]: Z coordinate

    Code sample :

    x, y, z = HYP_Object.GetBoundingVolumeAbsoluteCenter( object_id )


    HYP_Object.DisplayBoundingVolume

    Description
    Displays the bounding volume.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_Object.DisplayBoundingVolume(object_id, shape, state)


    HYP_Object.GetAbsolute_X_Axis

    Description
    GetAbsolute_X_Axis gets the X vector from the local center system (object system).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • 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

    Code sample :

    x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_X_Axis( myPlane_id )


    HYP_Object.GetAbsolute_Y_Axis

    Description
    GetAbsolute_Y_Axis gets the Y vector from the local center system (object system).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • 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

    Code sample :

    x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_Y_Axis( object_id )


    HYP_Object.GetAbsolute_Z_Axis

    Description
    GetAbsolute_Z_Axis gets the Z vector from the local center system (object system).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • 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

    Code sample :

    x_axis, y_axis, z_axis = HYP_Object.GetAbsolute_Z_Axis( myPlan_id )


    HYP_Object.SetObjectRelativeTransformMatrix

    Description
    Sets the local transformation matrix (OpenGL conventions) of an object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: object numeric identifier
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    HYP_Object.SetObjectRelativeTransformMatrix(id, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)


    HYP_Object.GetObjectAbsoluteTransformMatrix

    Description
    Gets the absolute transformation matrix (OpenGL conventions) of an object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: object numeric identifier

    Return Values
  • m0 .. to .. m15 [REAL]: 16 elements of the matrix

    Code sample :

    m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15 = HYP_Object.GetObjectAbsoluteTransformMatrix(id)


    HYP_Object.ComputeNormals

    Description
    Computes the vertices normals.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric identifier

    Code sample :

    HYP_Object.ComputeNormals(object_id)


    HYP_Object.ComputeTangentSpace

    Description
    Computes the normal vectors of the tangent space of each vertex. Useful for bump mapping.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]:

    Return Values
  • NONE []:

    Code sample :

    HYP_Object.ComputeTangentSpace(object_id)


    HYP_Object.AverageNormals

    Description
    AverageNormals computes an average from the vertices normals of an object. Has the same effect as HYP_RemoveSeam()

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.AverageNormals( object_id )


    HYP_Object.GetNumMaterials

    Description
    Returns the number of materials attached to an object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: object numeric identifier

    Return Values
  • n [INTEGER]: number of materials

    Code sample :

    n = HYP_Object.GetNumMaterials(id)


    HYP_Object.GetMaterialIndex

    Description
    Returns the material index in the object materials list.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: object numeric identifier
  • materialId [INTEGER]: material numeric identifier

    Return Values
  • index [INTEGER]: material index

    Code sample :

    index = HYP_Object.GetMaterialIndex(id, materialId)


    HYP_Object.FreeAllTextures

    Description
    Frees all textures of all materials of an object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: object numeric identifier

    Code sample :

    HYP_Object.FreeAllTextures(id)


    HYP_Object.GetParent

    Description
    Returns the numeric id of the parent object, or -1 if it fails.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • parent_id [INTEGER]: Parent object numeric Identifier

    Code sample :

    parent_id = HYP_Object.GetParent( object_id )


    HYP_Object.GetChild

    Description
    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.

    Languages: Lua - Python

    Parameters
  • parent_id [INTEGER]: Parent object numeric identifier.
  • child_id [INTEGER]: Child object numeric identifier.

    Return Values
  • id_child [INTEGER]: Child object numeric identifier

    Code sample :

    id_child = HYP_Object.GetChild(parent_id, child_id)


    HYP_Object.GetChildByIndex

    Description
    Gets the direct child of a parent object (first level of hierarchy).With succes returns the child id, or -1 if it fails.

    Languages: Lua - Python

    Parameters
  • parent_id [INTEGER]: Parent object numeric Identifier.
  • index [INTEGER]: Index of the child in the hierarchy.

    Return Values
  • id_child [INTEGER]: Child object numeric Identifier

    Code sample :

    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

    Description
    Returns the type of an object.

    Languages: Lua - Python

    Parameters
  • 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,

    Return Values
  • state [INTEGER]: 1 if type or 0 if not.

    Code sample :

    state = HYP_Object.IsTypeOf( object_id, type )


    HYP_Object.AddChild

    Description
    Adds a child object to a parent object.

    Languages: Lua - Python

    Parameters
  • parent_id [INTEGER]: parent Identifier
  • child_id [INTEGER]: child Identifier

    Code sample :

    HYP_Object.AddChild(parent_id,child_id)


    HYP_Object.RemoveChild

    Description
    Removes a child object from a parent object.

    Languages: Lua - Python

    Parameters
  • parent_id [INTEGER]: parent Identifier
  • child_id [INTEGER]: child Identifier

    Code sample :

    HYP_Object.RemoveChild(parent_id,child_id)


    HYP_Object.Check_AABB_Collision

    Description
    Check_AABB_Collision checks the collision state of two objects according to their Axis Aligned Bounding Box.Returns 1 for collision, else 0.

    Languages: Lua - Python

    Parameters
  • object_1_id [INTEGER]: object1 numeric Id
  • object_2_id [INTEGER]: object2 numeric Id

    Return Values
  • res [INTEGER]: 1 = collision, 0 = no collision.

    Code sample :

    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

    Description
    Check_BS_Collision checks collision state between two objects according to their respective Bounding Sphere

    Languages: Lua - Python

    Parameters
  • object_1_id [INTEGER]: object1 numeric Identifier
  • object_2_id [INTEGER]: object2 numeric Identifier

    Return Values
  • res [INTEGER]: 1 = collision, 0 = no collision.

    Code sample :

    res = HYP_Object.Check_BS_Collision( object_1_id, object_2_id );
    if(res==1) then
    ...
    end


    HYP_Object.CreateGizmo

    Description
    Creates a new gizmo.

    Languages: Lua - Python

    Return Values
  • id [INTEGER]: gizmo numeric Identifier

    Code sample :

    id = HYP_Object.CreateGizmo()


    HYP_Object.DestroyGizmo

    Description
    Destroys an existing gizmo

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: gizmo numeric Identifier

    Code sample :

    HYP_Object.DestroyGizmo(id)


    HYP_Object.KillAllTextures

    Description
    Removes and destroys all textures of an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • NONE []:

    Code sample :

    HYP_Object.KillAllTextures(object_id)


    HYP_Object.RemoveAllTextures

    Description
    Removes all textures of an object. The textures stay in memory for forcoming use.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • NONE []:

    Code sample :

    HYP_Object.RemoveAllTextures(object_id)


    HYP_Object.DisplayTripod

    Description
    Enables or disables the display of the object's tripod (the local system of an object).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.DisplayTripod(object_id, state)


    HYP_Object.GetAbsolutePitch

    Description
    Gets the current value of angle with the X axis relative to the world coordinate system.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetAbsolutePitch( object_id )


    HYP_Object.GetAbsoluteYaw

    Description
    Gets the current value of angle with the Y axis relative to the world coordinate system.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetAbsoluteYaw( object_id )


    HYP_Object.GetAbsoluteRoll

    Description
    Gets the current value of angle with the Z axis relative to the world coordinate system.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetAbsoluteRoll( object_id )


    HYP_Object.GetActiveState

    Description
    Gets the active state of an object

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: returns 1 for active , 0 for non active.

    Code sample :

    state = HYP_Object.GetActiveState( object_id )


    HYP_Object.GetBackFaceCullingState

    Description
    GetBackFaceCullingState shows if the back faces of polygons are activated for this object.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: returns 1 for active , 0 for non active.

    Code sample :

    state = HYP_Object.GetBackFaceCullingState( object_id )


    HYP_Object.GetBlendingState

    Description
    GetBlendingState shows if the blending state is activated for this object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: returns 1 for active , 0 for non active.

    Code sample :

    state = HYP_Object.GetBlendingState( object_id )


    HYP_Object.GetBlendingFactors

    Description
    GetBlendingFactors gets the source and destinations blending factors for an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • source_factor [INTEGER]: See SetBlendingFactors().
  • dest_factor [INTEGER]: See SetBlendingFactors().

    Code sample :

    source_factor, dest_factor = HYP_Object.GetBlendingFactors( object_id )


    HYP_Object.GetDirection

    Description
    Returns the object's direction vector. This vector corresponds to the local system Z axis.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • 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

    Code sample :

    new_x, new_y, new_z = HYP_Object.GetDirection( object_id )


    HYP_Object.GetDistanceBetween

    Description
    Returns the distance between the tripods of two objects.

    Languages: Lua

    Parameters
  • object_1_id [INTEGER]: object 1 numeric Identifier
  • object_2_id [INTEGER]: object 2 numeric Identifier

    Return Values
  • distance [REAL]: Distance in the world unit value.

    Code sample :

    dist = HYP_Object.GetDistanceBetween( fly_camera_id, SphereModel_id );
    if dist<200.0 then
    -- Do something...
    end


    HYP_Object.GetLightingState

    Description
    GetLightingState shows if the lighting equations are computed for this object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: returns 1 for activated , 0 for non activated.

    Code sample :

    state = HYP_Object.GetLightingState( object_id )


    HYP_Object.GetNumChildren

    Description
    Returns the number of direct childs of an object.With succes returns the childs number, or -1 if it fails.

    Languages: Lua - Python

    Parameters
  • parent_id [INTEGER]: Parent object numeric identifier

    Return Values
  • num_children [INTEGER]: Number of direct childs

    Code sample :

    num_children = HYP_Object.GetNumChildren( parent_id )


    HYP_Object.GetPitch

    Description
    Returns the current angle value around the local system X axis.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetPitch( object_id )


    HYP_Object.GetRenderState

    Description
    Returns the render state of an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    TRUE = 1;
    FALSE = 0;
    if (HYP_Object.GetRenderState(mySphere1_id) == FALSE) then
    HYP_Object.SetRenderState(mySphere1_id, TRUE);
    end


    HYP_Object.GetPickingState

    Description
    Shows if the picking state of an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    state = HYP_Object.GetPickingState( object_id )


    HYP_Object.GetRoll

    Description
    GetRoll returns the current angle value around the local system Z axis.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetRoll( object_id )


    HYP_Object.GetTexturingState

    Description
    GetTexturingState shows if texture application is activated on this object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    state = HYP_Object.GetTexturingState( object_id )


    HYP_Object.GetUpdateState

    Description
    GetUpdateState returns the update state of an object.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    state = HYP_Object.GetUpdateState( object_id )


    HYP_Object.GetUpdateTripodDirectionState

    Description
    GetUpdateTripodDirectionState returns the auto update direction state of the object's tripod.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    state = HYP_Object.GetUpdateTripodDirectionState( object_id )


    HYP_Object.GetYaw

    Description
    GetYaw returns the current angle value around the local system Y axis.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • angle [REAL]: Rotation angle in degrees.

    Code sample :

    angle = HYP_Object.GetYaw( object_id )


    HYP_Object.PopTripod

    Description
    Works in pair with PushTripod(). Restores a tripod previously saved by a call to PushTripod()

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.PopTripod(object_id)


    HYP_Object.PushTripod

    Description
    Pushes (saves) the object's current tripod in a register. A future call to PopTripod() will restore it.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.PushTripod(object_id)


    HYP_Object.Render

    Description
    Performs the rendering of an object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.Render( object_id )


    HYP_Object.ApplyRasterizerStatesToRenderer

    Description
    Applies the rasterizer states (flat or smooth, solid or wireframe, etc...) to the renderer. Useful for mesh instancing or in direct rendering.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.ApplyRasterizerStatesToRenderer(object_id)


    HYP_Object.ResetTripod

    Description
    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.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.ResetTripod(object_id)


    HYP_Object.SetAlphaMappedState

    Description
    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.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: TRUE (1): activated - FALSE (0): non activated

    Code sample :

    HYP_Object.SetAlphaMappedState( object_id, state )


    HYP_Object.SetActiveState

    Description
    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.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    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

    Description
    Enables or disables the rendering of an object's back faces.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetBackFaceCullingState( object_id, state )


    HYP_Object.SetFaceCullingState

    Description
    Enables or disables face culling.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetFaceCullingState(object_id, state)


    HYP_Object.SetFaceCullingMode

    Description
    Sets face culling mode: 0 (none), 1 (back), 2 (front), 3 (front and back).

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • mode [INTEGER]: face culling mode

    Code sample :

    HYP_Object.SetFaceCullingMode(object_id, 1)


    HYP_Object.SetColor

    Description
    Changes the object's colors.This color is used only wen a lighting is activated.Useful for setting a primitive color.

    Languages: Lua

    Parameters
  • 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.

    Code sample :

    HYP_Object.SetColor(object_id, r, g, b, a)


    HYP_Object.SetDirection

    Description
    SetDirection allows to change the direction by chaging the orientation of the object's local system Z axis.

    Languages: Lua

    Parameters
  • 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.

    Code sample :

    HYP_Object.SetDirection( object_id, new_x, new_y, new_z )


    HYP_Object.SetLineWidth

    Description
    Sets the width parameter for the rendering of a line. Valid when the wireframe rendering is on.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • width [REAL]: Thickness of the line drawn.

    Code sample :

    HYP_Object.SetLineWidth( object_id, width )


    HYP_Object.SetPointSize

    Description
    Sets the size parameter for the rendering of a point. Valid when the point rendering is on.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • pointSize [REAL]: size of the point.

    Code sample :

    HYP_Object.SetPointSize(object_id, pointSize)


    HYP_Object.SetPickingState

    Description
    Activates or desactivates the object's availability for picking operations.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetPickingState( object_id, state )


    HYP_Object.SetShadowCasterState

    Description
    Activates or desactivates volumic shadow projection for the mesh or model object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetShadowCasterState( object_id, state )


    HYP_Object.SetUpdateState

    Description
    Activates or desactivates the update state of an object.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetUpdateState( object_id, state )


    HYP_Object.SetUpdateTripodDirectionState

    Description
    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.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: 1 (enabled) or 0 (disabled)

    Code sample :

    HYP_Object.SetUpdateTripodDirectionState( object_id, state )


    HYP_Object.Translate

    Description
    Performs a translation of the object.

    Languages: Lua

    Parameters
  • 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

    Code sample :

    HYP_Object.Translate( object_id, dx, dy, dz, transform_space )


    HYP_Object.Update

    Description
    Updates an object. The update operations are transform matrix updates, normals computing and the internal shader of rendering(lighting, texturing, blending etc..)

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.Update(object_id)


    HYP_Object.UpdateGeometryData

    Description
    Allows to update the internal structures of an object after modifications on its geometry. This function is used for meshes.

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.UpdateGeometryData( object_id )


    HYP_Object.UpdateTripod

    Description
    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

    Languages: Lua

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Code sample :

    HYP_Object.UpdateTripod( object_id )


    HYP_Object.SetDrawVertexNormalState

    Description
    Enables or disables the display of vertices normals. Currently only valid for mesh object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: Enabled (1) or disabled (0)

    Code sample :

    HYP_Object.SetDrawVertexNormalState(meshId, 1)


    HYP_Object.GetDrawVertexNormalState

    Description
    Gets the drawing state of vertices normals. Currently only valid for mesh object.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier

    Return Values
  • state [INTEGER]: Enabled (1) or disabled (0)

    Code sample :

    state = HYP_Object.GetDrawVertexNormalState(meshId)


    HYP_Object.SetDrawVertexNormalLengthFactor

    Description
    Sets the length factor for vertices normals display.

    Languages: Lua - Python

    Parameters
  • object_id [INTEGER]: object numeric Identifier
  • state [INTEGER]: Enabled (1) or disabled (0)

    Code sample :

    HYP_Object.SetDrawVertexNormalState(meshId, 1)




  • Random Projects

    Phong Lighting Multiple Lights
    Phong Lighting Multiple Lights

    Night Vision PostFX
    Night Vision PostFX

    Bump Mapping Multiple Lights
    Bump Mapping Multiple Lights


    Random Code Samples

    W4K Format Loading
    W4K Format Loading

    Draw Line
    Draw Line

    Simple Bump Mapping
    Simple Bump Mapping



    (C)2009-2010 Geeks3D.com