Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.video.opengl

Class EM_3D_OBJECT


Direct ancestors

GL_FUNCTIONS

Known direct descendants

EM_3D_OBJECT_CONTAINER, EM_3D_OBJECT_DISPLAYLIST

Features

Invariants

indexing

description

This interface represents 3d objects that can be drawn to the framebuffer.

date

$Date$

revision

$Revision$

deferred class

EM_3D_OBJECT

feature -- Commands

draw

-- Draws the object to the framebuffer at the 'origin' position
-- with a given rotation and scales it with the 'scale' vector

set_origin (a_x: DOUBLE; a_y: DOUBLE; a_z: DOUBLE)

-- Specify the origin

ensure
origin_x_set: origin.x = a_x
origin_y_set: origin.y = a_y
origin_z_set: origin.z = a_z
set_rotation (a_x: DOUBLE; a_y: DOUBLE; a_z: DOUBLE)

-- Specify the rotation

ensure
angle_x_set: angle_x = a_x
angle_y_set: angle_y = a_y
angle_z_set: angle_z = a_z
set_scale (a_x: DOUBLE; a_y: DOUBLE; a_z: DOUBLE)

-- Specify the scale vector

require
a_x /= 0a_y /= 0a_z /= 0
ensure
scale_x_set: scale.x = a_x
scale_y_set: scale.y = a_y
scale_z_set: scale.z = a_z
width_updated: width = old (width) * a_x / old (scale.x)
height_updated: height = old (height) * a_y / old (scale.y)
depth_updated: depth = old (depth) * a_z / old (scale.z)

feature {EM_3D_OBJECT} -- Deferred features to be implemented

draw_object

-- Draws the object to the framebuffer at the current position

feature -- Status

angle_x: DOUBLE

-- The angle between the x-axis and our direction

angle_y: DOUBLE

-- The angle between the y-axis and our direction

angle_z: DOUBLE

-- The angle between the z-axis and our direction

depth: DOUBLE

-- The size of the bounding box in z-direction

height: DOUBLE

-- The size of the bounding box in y-direction

origin: EM_3D_VECT

-- The start coordinates of the object

scale: EM_3D_VECT

-- The scale vector of the object

width: DOUBLE

-- The size of the bounding box in x-direction

invariant

width_correct: width > 0
height_correct: height > 0
depth_correct: depth > 0
scale_x_not_0: scale.x /= 0
scale_y_not_0: scale.y /= 0
scale_z_not_0: scale.z /= 0

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end