Class OgreSceneManager

  • All Implemented Interfaces:
    be.yildizgames.common.jni.Native, be.yildizgames.module.graphic.SceneManager

    public final class OgreSceneManager
    extends Object
    implements be.yildizgames.module.graphic.SceneManager, be.yildizgames.common.jni.Native
    Java part of the yz::SceneManager.
    Author:
    Grégory Van den Borre
    • Constructor Detail

      • OgreSceneManager

        public OgreSceneManager​(String name,
                                be.yildizgames.common.jni.NativePointer pointer,
                                OgreRenderWindow renderWindow,
                                int screenSizeX,
                                int screenSizeY)
        Full constructor.
        Parameters:
        pointer - SceneManager native pointer.
        renderWindow - Engine render window.
        screenSizeX - Screen width.
        screenSizeY - Screen height.
    • Method Detail

      • setAmbientLight

        public void setAmbientLight​(be.yildizgames.module.color.Color color)
        Set this world ambient light, default is black. Without setting it, nothing will be visible if no light is created.
        Parameters:
        color - World ambient light color.
      • createBillboardChain

        public OgreBillboardChain createBillboardChain()
        Create a new billboard chain.
        Returns:
        The created billboard chain.
      • createPointLight

        public OgrePointLight createPointLight​(String name,
                                               be.yildizgames.common.geometry.Point3D position)
        Create a light of type PointLight.
        Parameters:
        name - Light name, must be unique.
        position - Light position.
        Returns:
        The created point light.
      • createSpotLight

        public OgreSpotLight createSpotLight​(String name,
                                             be.yildizgames.common.geometry.Point3D position,
                                             be.yildizgames.common.geometry.Point3D direction)
        Create a light of type spotlight.
        Parameters:
        name - Light name, must be unique.
        position - Spot position.
        direction - Spot direction.
        Returns:
        The created spot light.
      • createDirectionalLight

        public OgreDirectionalLight createDirectionalLight​(String name,
                                                           be.yildizgames.common.geometry.Point3D position,
                                                           be.yildizgames.common.geometry.Point3D direction)
        Create a light of type directional light.
        Parameters:
        name - Light name, must be unique.
        position - Light position.
        direction - Light direction.
        Returns:
        The created directional light.
      • getDefaultCamera

        public be.yildizgames.module.graphic.camera.Camera getDefaultCamera()
        Returns:
        The Camera created at same time as this manager.
      • createElectricArc

        public OgreElectricArc createElectricArc​(be.yildizgames.common.geometry.Point3D start,
                                                 be.yildizgames.common.geometry.Point3D end,
                                                 float width)
        Create an ElectricArc.
        Parameters:
        start - Arc start position.
        end - Arc end position.
        width - Element width.
        Returns:
        An Ogre implementation for ElectricArc.
      • createOcean

        public OgreHydrax createOcean()
        Create an Ocean.
        Returns:
        An Ogre implementation for Ocean.
      • createSky

        public OgreSkyX createSky()
        Create a Sky.
        Returns:
        An Ogre implementation for a Sky.
      • setSkybox

        public void setSkybox​(be.yildizgames.module.graphic.misc.Skybox sky)
        Set a sky box in the scene.
        Parameters:
        sky - Sky box to use.
      • createLine

        public OgreLine createLine()
        Create a simple 3d line.
        Returns:
        The created line.
      • createStaticNode

        public final OgreNodeStatic createStaticNode​(be.yildizgames.common.geometry.Point3D position,
                                                     be.yildizgames.common.geometry.Point3D direction)
      • createStaticNode

        public final OgreNodeStatic createStaticNode​(be.yildizgames.common.model.EntityId id,
                                                     be.yildizgames.common.geometry.Point3D position,
                                                     be.yildizgames.common.geometry.Point3D direction)
      • createMovableNode

        public final OgreNodeMovable createMovableNode​(be.yildizgames.common.model.EntityId id)
      • createLensFlare

        public OgreLensFlare createLensFlare​(be.yildizgames.module.graphic.material.Material light,
                                             be.yildizgames.module.graphic.material.Material streak,
                                             be.yildizgames.module.graphic.material.Material halo,
                                             be.yildizgames.module.graphic.material.Material burst,
                                             be.yildizgames.common.geometry.Point3D pos)
        Create a lens flare.
        Parameters:
        light - Lens light material.
        streak - Lens streak material.
        halo - Lens halo material.
        burst - Lens burst Material.
        pos - Lens initial position.
        Returns:
        The created lens flare.
      • createCamera

        public OgreCamera createCamera​(String name)
        Create a new camera with default behavior(free fly).
        Parameters:
        name - Camera name, must be unique.
        Returns:
        The newly built camera.
      • createQuery

        public OgreQuery createQuery​(be.yildizgames.module.graphic.RayProvider provider)
      • createGroundQuery

        public OgreGroundQuery createGroundQuery​(be.yildizgames.module.graphic.RayProvider provider)
      • createEntity

        public OgreEntity createEntity​(be.yildizgames.module.graphic.GraphicMesh mesh,
                                       OgreNodeBase node)
        Create a mesh entity.
        Parameters:
        mesh - Contains mesh name.
        node - The created entity will be attached to this node.
        Returns:
        The built mesh entity.
      • createEntity

        public OgreEntity createEntity​(be.yildizgames.common.shape.Box box,
                                       OgreNodeBase node)
        Create a box entity, by default Ogre build 100*100*100 box, to resize it to the correct dimensions, the node scale is divided by 100.
        Parameters:
        box - Contains the box dimensions data.
        node - The created entity will be attached to this node.
        Returns:
        The built box entity.
      • createEntity

        public OgreEntity createEntity​(be.yildizgames.common.shape.Plane plane,
                                       OgreNodeBase node)
        Create a plane entity, by default Ogre build 100*100 plane, to resize it to the correct dimensions, the node scale is divided by 100.
        Parameters:
        plane - Contains the plane dimensions data.
        node - The created entity will be attached to this node.
        Returns:
        The built plane entity.
      • createEntity

        public OgreEntity createEntity​(be.yildizgames.common.shape.Sphere sphere,
                                       OgreNodeBase node)
        Create a sphere entity, by default Ogre build 100 radius sphere, to resize it to the correct dimensions, the node scale is divided by 100.
        Parameters:
        sphere - Contains the sphere dimension data.
        node - The created entity will be attached to this node.
        Returns:
        The built sphere entity.
      • createMovableText

        public OgreMovableText createMovableText​(String name,
                                                 String text,
                                                 be.yildizgames.module.graphic.Font font)
        Create a movable text object.
        Parameters:
        name - Object unique name.
        text - Text to display.
        font - Font to use.
        Returns:
        The created movable text object.
      • createParticleSystem

        public OgreParticleSystem createParticleSystem()
        Create a new ParticleSystem.
        Returns:
        An OgreParticleSystem.
      • setShadowType

        public void setShadowType​(be.yildizgames.module.graphic.ShadowType type)
        Set the world shadow type.
        Parameters:
        type - Shadow type to set.
      • createBillboardSet

        public OgreBillboardSet createBillboardSet​(be.yildizgames.module.graphic.material.Material material)
        Create a billboard set and attach it to the root scene node.
        Parameters:
        material - Material to set on the set.
        Returns:
        A new OgreBillboardSet attached to the root scene node.
      • createExplosion

        public OgreParticleSystem[] createExplosion()
        Create an explosion object.
        Returns:
        The created object.
      • getCamera

        public OgreCamera getCamera​(String name)
        Get a camera from its name.
        Parameters:
        name - Camera name.
        Returns:
        The camera matching the name.
      • delete

        public void delete()
        Specified by:
        delete in interface be.yildizgames.common.jni.Native
      • getPointer

        public be.yildizgames.common.jni.NativePointer getPointer()
        Specified by:
        getPointer in interface be.yildizgames.common.jni.Native
      • getName

        public String getName()