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:
- Define the settings structure
OgreSettings
. - Define your scene by building up an
OgreScene
. - call
initOgre
with your OgreSettings as the parameter. - add your scene using
addScene
. - Call
renderOgre
in a loop. - To ensure clean shutdown, call
cleanupOgre
.
- data Vector3 = Vector3 {}
- type Angle = Float
- data Rotation = YPR {}
- data Color = Color {}
- data TransformSpace
- data ShadowTechnique
- data Light = Light {}
- data LightType
- = PointLight { }
- | DirectionalLight { }
- | SpotLight {
- slposition :: Vector3
- sldirection :: Vector3
- range :: (Angle, Angle)
- data EntityType
- data Camera = Camera {}
- data Entity = Entity {
- name :: String
- position :: Vector3
- entitytype :: EntityType
- castshadows :: Bool
- scale :: Vector3
- data OgreSettings = OgreSettings {}
- data OgreScene = OgreScene {}
- data SceneManagerType
- = Generic
- | ExteriorClose
- | ExteriorFar
- | ExteriorRealFar
- | Interior
- halfPI :: Float
- degToRad :: Float -> Float
- unitX :: Vector3
- unitY :: Vector3
- unitZ :: Vector3
- negUnitX :: Vector3
- negUnitY :: Vector3
- negUnitZ :: Vector3
- initOgre :: OgreSettings -> IO ()
- addScene :: OgreScene -> IO ()
- setupCamera :: Camera -> IO ()
- clearScene :: IO ()
- addLight :: Light -> IO ()
- addEntity :: Entity -> IO ()
- setLightPosition :: String -> Vector3 -> IO ()
- setEntityPosition :: String -> Vector3 -> IO ()
- rotateEntity :: String -> Rotation -> TransformSpace -> IO ()
- rotateCamera :: Rotation -> TransformSpace -> IO ()
- translateEntity :: String -> Vector3 -> TransformSpace -> IO ()
- translateCamera :: Vector3 -> IO ()
- setLightVisible :: String -> Bool -> IO ()
- setAmbientLight :: Color -> IO ()
- setSkyDome :: Maybe (String, Float) -> IO ()
- setWorldGeometry :: String -> IO ()
- setCameraPosition :: Vector3 -> IO ()
- getCameraPosition :: IO Vector3
- raySceneQuerySimple :: Vector3 -> Vector3 -> IO (Maybe Vector3)
- raySceneQueryMouseSimple :: Float -> Float -> IO (Maybe Vector3)
- renderOgre :: IO ()
- cleanupOgre :: IO ()
Documentation
data TransformSpace Source
data ShadowTechnique Source
Constructors
None | |
StencilModulative | Note: as of 0.0.1, stencil shadows do not work when the window was created by SDL. |
StencilAdditive | |
TextureModulative | |
TextureAdditive | |
TextureAdditiveIntegrated | |
TextureModulativeIntegrated |
Constructors
Light | |
Constructors
PointLight | |
Fields | |
DirectionalLight | |
Fields | |
SpotLight | |
Fields
|
data EntityType Source
For Plane parameters, see OGRE documentation at http://www.ogre3d.org/docs/api/html/classOgre_1_1Plane.html and Ogre::MeshManager::createPlane: http://www.ogre3d.org/docs/api/html/classOgre_1_1MeshManager.html
Instances
Constructors
Entity | |
Fields
|
data OgreSettings Source
General, scene-wide Ogre settings. Main configuration structure for Ogre.
Constructors
OgreSettings | |
Fields
|
Instances
Entities and other objects that define the scene.
data SceneManagerType Source
Constructors
Generic | |
ExteriorClose | |
ExteriorFar | |
ExteriorRealFar | |
Interior |
initOgre :: OgreSettings -> IO ()Source
Initializes Ogre with given settings. This must be called before manipulating or rendering the scene.
setupCamera :: Camera -> IO ()Source
clearScene :: IO ()Source
rotateEntity :: String -> Rotation -> TransformSpace -> IO ()Source
rotateCamera :: Rotation -> TransformSpace -> IO ()Source
translateEntity :: String -> Vector3 -> TransformSpace -> IO ()Source
translateCamera :: Vector3 -> IO ()Source
setAmbientLight :: Color -> IO ()Source
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().
setCameraPosition :: Vector3 -> IO ()Source
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.