|
|
Animation
AnimationTrack
Camera
KeyFrame
MovableObject
Entity
Light
Particles
Organic
TextureBlitter
exceptions.Exception(exceptions.BaseException)
SceneError
AnimationError
CameraError
EntityError
LightError
MovableObjectError
OrganicError
ParticleError
TextureBlitterError
class Camera
|
|
Request for refactoring. Currenlty we handle the camera creation and cleanup. Ogre should do it instead.
|
|
Methods
defined here:
__init__(self)
Is meant to give access to the one default camera
attach(self, entityName=None)
This will attach the camera to an entity having name entityName, the entity must exist. If no
entity is defined then the camera is detached and "free".
When attached you can still control the camera but in the entitys local space. You will be able to
set lookAt and lookAtEntity where the camera will follow the attached entity and look at the targets.
Calling followEntity will detach the camera from the object (restoring it).
Deleting an entity havning a camera attached will delete the default camera :(.
disable(self)
Will remove any behavoirs on camera.
followEntity(self,
name='')
Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not following at the deleted entity (will cause crash).
lookAtDirection(self, x, y, z)
Turns the camera to the specified direction
lookAtEntity(self,
name='')
Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not looking at the deleted entity (will cause crash).
setFOV(self, fov=0.80000000000000004)
Sets field of view, 0.8 is a good value
setFlyFreeControl(self, moveScale=None, rotationScale=None)
Will enable fly free camera control for camera. If moveScale and rotationScale is provided
these values will be used in transition per unit.
setFlyFreeControlKeys(self, MoveLeft, MoveRight,
MoveForward, MoveBackward,
MoveUp, MoveDown, RotateLeft, RotateRight)
Sets what keys are used when we control the camera in free fly mode.
setFollowProperties(self, followFactor, followRotationFactor,
height, distance, lookAhead=100)
Applies the follow scene node factors. How the scene node is followed.
setOrientation(self, w, x, y, z)
Rotates the camera
setPosition(self, x, y, z)
Positions the camera
setTargetEntity(self, name='')
Where name is null or a loaded movable object. Critical: pass null value (disabling) before unloading the
entity. So we are not looking at the deleted entity (will cause crash).
useCamera(self, cameraName=None)
This will change the camera from the current to the specified 'cameraName'. The camera named 'cameraName'
must exist in the system (you can create through loading external scenes, like through call loadScene(...)).
Critical: pass null value (disabling) before unloading the scene that created the camera.
Passing None (or '') will select the default camera.
If the camera does not exist we raise an SceneError.
|
class Entity(MovableObject)
|
|
Handles a mesh, use SceneManager addEntity instead of calling this directly
|
|
Methods defined here:
__init__(self, name,
file=None)
This class should not be instanced directly use SceneManager.addEntity(...)
__str__(self)
Formated string describing name, file, animation names and position of the Entity
getAllAnimationNames(self)
Returns a list of all the animations supported by this entity.
playAnimation(self,
name, loop=False, enabled=True)
Plays entity animation and returns None on success. Else raises an EntityError.
setMaterial(self, MaterialName)
Sets this entites material. Replaces the material currently in use.
stopAnimation(self,
name)
Plays entity animation and returns None on success. Else raises an EntityError.
Data and
other attributes defined here:
file = ''
Methods
inherited from MovableObject:
attach(self, movableobject,
position=[])
Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will
be attached to this objects parent scene node (inheriting its translations + applying its current transitions).
Cameras are not supported.
getChildren(self)
getDistanceTo(self, toObject)
Returns the distance to the object 'toObject'
getOrientation(self, world=False)
Returs the movable objects orientation in the form of list having four values being [w, x, y, z].
If world is true then we will get the orientation after all applied orientation to parents.
If world is false then we get the orientation in relation to parent.
getPitch(self)
Returns movable objects 'degree' around x axis
getPosition(self, world=False)
Returns movable objects position in the form of a list having three float values [x, y, z]
If world is true then we will get the final position after all applied translation to parents.
If world is false then we get the translation in relation to parent.
getRoll(self)
Returns movable objects 'degree' around z axis
getScale(self)
Returns movable objects scale in the form of a list having three float values [x, y, z]
getSize(self)
Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).
getYaw(self)
Returns movable objects 'degree' around y axis
rotate(self, w, x, y, z, time=None, args=None)
Rotates an object. Behaves exactly as setOrientation
scale(self, x, y, z)
Scales relative to current scale
setOrientation(self, w, x, y, z, time=None, args=None)
Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation
during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list
values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].
Method raises MovableObjectError on failure and None on success.
setPitch(self, degree)
Rotates object 'degree' around x axis
setPosition(self, x, y, z, type='Absolute', time=None, args=None)
Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current
location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two
list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].
Method raises MovableObjectError on failure and None on success.
setRoll(self, degree)
Rotates object 'degree' around z axis
setScale(self, x, y, z,
relative=False)
Scales relative to current scale
setVisible(self, b=True, cascade=True)
if b is True then we set this object visable and all its children
setYaw(self, degree)
Rotates object 'degree' around y axis
showBoundingbox(self, b=True)
if b is true then we display this object bounding box
translate(self, x, y, z,
time=None, args=None)
Moves movable object relative to its parent
Data and other attributes inherited from MovableObject:
name = None
|
class KeyFrame
|
|
KeyFrame is the class that positions an animated movable object by setting the subsiquent transition, rotation or scale at
specified time position.
Use AnimationTrack class to create key frames. AnimationTrack can have zero to many key frames.
To remove animation track call SceneManager.delAnimation(...).
|
|
Methods
defined here:
__init__(self, id, attrib, timePos)
This class should not be instanced directly use SceneManager.addAnimation(...) and then Animation.addTrack(...)
and lastly AnimationTrack.addKeyFrame(...)
setRotation(self, q, x, y, z)
Sets the rotation applied by this keyframe. Returns None on success but raises AnimationError on failure
setScale(self, x, y, z)
Sets the scaling factor applied by this keyframe to the animable object at it's time index. Returns None on success
but raises AnimationError on failure
setTranslate(self, x, y, z)
Sets the translation associated with this keyframe. Returns None on success but raises AnimationError on failure
Data and
other attributes defined here:
id = 0
|
class Light(MovableObject)
|
|
##############################################
# Light
# Representation of a dynamic light source in the scene
##############################################
|
|
Methods
defined here:
__init__(self, name)
This class should not be instanced directly use SceneManager.addLight(...)
__str__(self)
Formated string describing name, file, animation names and position of the Light
setDiffuseColor(self, r,
g, b)
setDirection(self, x,
y, z)
Sets the light to directional light mode and direction in which a light points.
setFalloffRange(self, innerAngle, outerAngle,
falloff)
Sets the light to spotlight mode.
Sets the falloff between the inner and outer cones of the spotlight.
Where:
innerAngle is the angle in degrees covered by the bright inner cone The inner cone applicable only to Direct3D, it'll always treat as zero in OpenGL.
outerAngle is the angle in degrees covered by the outer cone
falloff is the rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.
Methods
inherited from MovableObject:
attach(self, movableobject,
position=[])
Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will
be attached to this objects parent scene node (inheriting its translations + applying its current transitions).
Cameras are not supported.
getChildren(self)
getDistanceTo(self, toObject)
Returns the distance to the object 'toObject'
getOrientation(self, world=False)
Returs the movable objects orientation in the form of list having four values being [w, x, y, z].
If world is true then we will get the orientation after all applied orientation to parents.
If world is false then we get the orientation in relation to parent.
getPitch(self)
Returns movable objects 'degree' around x axis
getPosition(self, world=False)
Returns movable objects position in the form of a list having three float values [x, y, z]
If world is true then we will get the final position after all applied translation to parents.
If world is false then we get the translation in relation to parent.
getRoll(self)
Returns movable objects 'degree' around z axis
getScale(self)
Returns movable objects scale in the form of a list having three float values [x, y, z]
getSize(self)
Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).
getYaw(self)
Returns movable objects 'degree' around y axis
rotate(self, w, x, y, z, time=None, args=None)
Rotates an object. Behaves exactly as setOrientation
scale(self, x, y, z)
Scales relative to current scale
setOrientation(self, w, x, y, z, time=None, args=None)
Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation
during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list
values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].
Method raises MovableObjectError on failure and None on success.
setPitch(self, degree)
Rotates object 'degree' around x axis
setPosition(self, x, y, z, type='Absolute', time=None, args=None)
Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current
location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two
list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].
Method raises MovableObjectError on failure and None on success.
setRoll(self, degree)
Rotates object 'degree' around z axis
setScale(self, x, y, z,
relative=False)
Scales relative to current scale
setVisible(self, b=True, cascade=True)
if b is True then we set this object visable and all its children
setYaw(self, degree)
Rotates object 'degree' around y axis
showBoundingbox(self, b=True)
if b is true then we display this object bounding box
translate(self, x, y, z, time=None, args=None)
Moves movable object relative to its parent
Data and other attributes inherited from MovableObject:
name = None
|
class MovableObject
|
|
Class representing a primitive object in the scene graph, is never used through direct initalization
|
|
Methods defined here:
__init__(self)
Abstract class initalization call that raises an error when called directly
__str__(self)
Formated string describing name and position of the object
attach(self, movableobject,
position=[])
Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will
be attached to this objects parent scene node (inheriting its translations + applying its current transitions).
Cameras are not supported.
getChildren(self)
getDistanceTo(self, toObject)
Returns the distance to the object 'toObject'
getOrientation(self, world=False)
Returs the movable objects orientation in the form of list having four values being [w, x, y, z].
If world is true then we will get the orientation after all applied orientation to parents.
If world is false then we get the orientation in relation to parent.
getPitch(self)
Returns movable objects 'degree' around x axis
getPosition(self, world=False)
Returns movable objects position in the form of a list having three float values [x, y, z]
If world is true then we will get the final position after all applied translation to parents.
If world is false then we get the translation in relation to parent.
getRoll(self)
Returns movable objects 'degree' around z axis
getScale(self)
Returns movable objects scale in the form of a list having three float values [x, y, z]
getSize(self)
Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).
getYaw(self)
Returns movable objects 'degree' around y axis
rotate(self, w, x, y, z, time=None, args=None)
Rotates an object. Behaves exactly as setOrientation
scale(self, x, y, z)
Scales relative to current scale
setOrientation(self, w, x, y, z, time=None, args=None)
Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation
during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list
values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].
Method raises MovableObjectError on failure and None on success.
setPitch(self, degree)
Rotates object 'degree' around x axis
setPosition(self, x, y, z, type='Absolute', time=None, args=None)
Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current
location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two
list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].
Method raises MovableObjectError on failure and None on success.
setRoll(self, degree)
Rotates object 'degree' around z axis
setScale(self, x, y, z, relative=False)
Scales relative to current scale
setVisible(self, b=True, cascade=True)
if b is True then we set this object visable and all its children
setYaw(self, degree)
Rotates object 'degree' around y axis
showBoundingbox(self, b=True)
if b is true then we display this object bounding box
translate(self, x, y, z,
time=None, args=None)
Moves movable object relative to its parent
Data and other attributes defined here:
name = None
|
class Particles(MovableObject)
|
|
Class defining particle system based special effects
|
|
Methods defined here:
__init__(self, name, effectName)
This class should not be instanced directly use SceneManager.addParticles(...)
Methods
inherited from MovableObject:
__str__(self)
Formated string describing name and position of the object
attach(self, movableobject,
position=[])
Attaches the 'movableobjectname' to this movable object. The object must exists and be loaded into ogre.
When attaching an object it will detach the objects parent scene node from its parent. Then it will
be attached to this objects parent scene node (inheriting its translations + applying its current transitions).
Cameras are not supported.
getChildren(self)
getDistanceTo(self, toObject)
Returns the distance to the object 'toObject'
getOrientation(self, world=False)
Returs the movable objects orientation in the form of list having four values being [w, x, y, z].
If world is true then we will get the orientation after all applied orientation to parents.
If world is false then we get the orientation in relation to parent.
getPitch(self)
Returns movable objects 'degree' around x axis
getPosition(self, world=False)
Returns movable objects position in the form of a list having three float values [x, y, z]
If world is true then we will get the final position after all applied translation to parents.
If world is false then we get the translation in relation to parent.
getRoll(self)
Returns movable objects 'degree' around z axis
getScale(self)
Returns movable objects scale in the form of a list having three float values [x, y, z]
getSize(self)
Returns movable objects size in the form of a list having three float values [x, y, z] after scale
(the bounding box size).
getYaw(self)
Returns movable objects 'degree' around y axis
rotate(self, w, x, y, z, time=None, args=None)
Rotates an object. Behaves exactly as setOrientation
scale(self, x, y, z)
Scales relative to current scale
setOrientation(self, w, x, y, z, time=None, args=None)
Sets the orientation of our object. If time is set then we interpolate linearly from current orientation to the desired (w, x, y, z) orientation
during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a cubic (Ogre::Quaternion::Squad) function. The spline function takes two list
values each having four values that will be used to calculate the interpolation. The arg format is as follows [[w,x,y,z],[w,x,y,z]].
Method raises MovableObjectError on failure and None on success.
setPitch(self, degree)
Rotates object 'degree' around x axis
setPosition(self, x, y, z, type='Absolute', time=None, args=None)
Sets the position of our object, where type is either 'Absolute' or 'Relative'. Where 'Relative' uses the objects position as reference
and sets the position relative to that. Absolute moves the object in worlds space. If time is set then we interpolate linearly from current
location to the desired (x, y, z) position during time 'time'. Where time is in milli seconds.
If arg is set then we interpolate using the arg values as input to a spline (Ogre::SimpleSpline) function. The spline function takes two
list values each having three values that will be used to calculate the interpolation. The arg format is as follows [[x,y,z],[x,y,z]].
Method raises MovableObjectError on failure and None on success.
setRoll(self, degree)
Rotates object 'degree' around z axis
setScale(self, x, y, z, relative=False)
Scales relative to current scale
setVisible(self, b=True, cascade=True)
if b is True then we set this object visable and all its children
setYaw(self, degree)
Rotates object 'degree' around y axis
showBoundingbox(self, b=True)
if b is true then we display this object bounding box
translate(self, x, y, z,
time=None, args=None)
Moves movable object relative to its parent
Data and other attributes inherited from MovableObject:
name = None
|
class TextureBlitter
|
|
|
Methods defined here:
__del__(self)
Destroys the texture blitter.
__init__(self, textureName, fileName, resourceGroup, width, height)
Creates the instance and texture file. The textureName will be the name refered by material scripts and
file name is the name of the file which we start from (this can be an empty image (64x64). The fileName must
be accessable from the resource group 'resourceGroup'. The width and height must be larger than 0 and represents
the final images size.
This instance must be destroyed before exiting the application. Otherwise it causes a crash during unload.
__str__(self)
addSource(self, name, x, y, w, h, texture, resourceGroup='General', flipX=False, flipY=False)
Adds a sticker source definition to the collection and sets its dimensions.
Where texture is the name of the texture file and x, y, w, h is the location within the
texture where we take the image.
If flipX is true then it will load this image and flip it in the x axis.
If flipY is true then it will load this image and flip it in the y axis.
addTarget(self, name, x, y, w, h)
Adds a sticker location to the collection and sets its dimensions.
Where targetName is the name to identify this location. x and y is the relative
location on the bitmap (a number between 0 and 1) and w and h is the relative
width and height of the target image.
paint(self, sourceName,
targetName)
Will set the sticker onto target location.
Data and other attributes defined
here:
height = None
id = None
name = None
resourceGroup = None
width = None
|
|