hogre-0.0.3: Haskell binding to a subset of OGRE

Graphics.Ogre.Ogre

Description

This module allows simple OGRE usage from Haskell. Note that you need OGRE libraries and headers. Tested with OGRE version 1.7.0dev-unstable (Cthugha) and 1.6.4 (Shoggoth). Usage for a simple scene creation:

  1. Define the settings structure OgreSettings.
  2. Define your scene by building up an OgreScene.
  3. call initOgre with your OgreSettings as the parameter.
  4. add your scene using addScene.
  5. Call renderOgre in a loop.
  6. To ensure clean shutdown, call cleanupOgre.

Synopsis

Documentation

data Vector3 Source

Constructors

Vector3 

Fields

x :: Float
 
y :: Float
 
z :: Float
 

data Rotation Source

Constructors

YPR 

Fields

yaw :: Angle
 
pitch :: Angle
 
roll :: Angle
 

data Color Source

Constructors

Color 

Fields

r :: Float
 
g :: Float
 
b :: Float
 

Instances

data Light Source

Constructors

Light 

Instances

data Camera Source

Constructors

Camera 

data Entity Source

Constructors

Entity 

Fields

name :: String

Unique identifier for the entity.

position :: Vector3
 
entitytype :: EntityType

EntityType is usually a mesh.

castshadows :: Bool
 
scale :: Vector3
 

data OgreSettings Source

General, scene-wide Ogre settings. Main configuration structure for Ogre.

Constructors

OgreSettings 

Fields

resourcefile :: FilePath

Path to resources.cfg.

autocreatewindow :: Bool

Whether the window should be created automatically (by Ogre). Turn this off if the window should be created by another library (e.g.) SDL.

caption :: String

Window caption.

ambientlight :: Color
 
shadowtechnique :: ShadowTechnique
 
scenemanagertype :: [SceneManagerType]

Flags for the scene manager. Most scenes only need to set Generic as type.

data OgreScene Source

Entities and other objects that define the scene.

Constructors

OgreScene 

Fields

camera :: Camera
 
entities :: [Entity]
 
lights :: [Light]
 

initOgre :: OgreSettings -> IO ()Source

Initializes Ogre with given settings. This must be called before manipulating or rendering the scene.

setLightPositionSource

Arguments

:: String

Name of light

-> Vector3

New position

-> IO () 

setEntityPositionSource

Arguments

:: String

Name of entity

-> Vector3

New position

-> IO () 

setSkyDomeSource

Arguments

:: Maybe (String, Float)

If Nothing, will disable sky dome. Otherwise, String refers to the material name. Float defines the curvature.

-> IO () 

See Ogre::SceneManager::setSkyDome().

setWorldGeometry :: String -> IO ()Source

See Ogre::SceneManager::setWorldGeometry().

raySceneQuerySimpleSource

Arguments

:: Vector3

Origin of ray

-> Vector3

Direction of ray

-> IO (Maybe Vector3)

Point where ray intersects something, or Nothing if not found

Creates a ray scene query.

raySceneQueryMouseSimpleSource

Arguments

:: Float

X-coordinate (width) of the ray origin on screen, between 0 (left) and 1 (right).

-> Float

Y-coordinate (height) of the ray origin on screen, between 0 (top) and 1 (bottom).

-> IO (Maybe Vector3)

Point where ray intersects something, or Nothing if not found

Creates a ray scene query based on given mouse coordinates.

renderOgre :: IO ()Source

renderOgre renders one frame.