コード例 #1
0
//-----------------------------------------------------------------------------------------
void CBillboardSetEditor::_addBillboard()
{
    Ogre::String propName;
    Ogre::String propName2;
    OgitorsPropertyDef *definition;

    int count = mBillboardCount->get();

    Ogre::Billboard *pBillboard = 0;
    if(mBillboardSetHandle)
        pBillboard = mBillboardSetHandle->createBillboard(Ogre::Vector3::ZERO);

    Ogre::String sCount1 = "Billboards::Billboard" + Ogre::StringConverter::toString(count);
    Ogre::String sCount2 = "billboard" + Ogre::StringConverter::toString(count);

    mFactory->AddPropertyDefinition(sCount2 + "::position", sCount1 + "::Position", "Billboard position.", PROP_VECTOR3);
    mFactory->AddPropertyDefinition(sCount2 + "::colour", sCount1 + "::Colour", "Billboard colour.", PROP_COLOUR);
    mFactory->AddPropertyDefinition(sCount2 + "::rotation", sCount1 + "::Rotation", "Billboard rotation.", PROP_REAL);
    definition = mFactory->AddPropertyDefinition(sCount2 + "::dimensions", sCount1 + "::Dimensions", "Billboard dimensions.", PROP_VECTOR2);
    definition->setFieldNames("Width","Height");
    mFactory->AddPropertyDefinition(sCount2 + "::texcoordindex", sCount1 + "::TexCoordIndex", "Billboard texture coordination index.", PROP_INT);
    definition = mFactory->AddPropertyDefinition(sCount2 + "::texrect", sCount1 + "::TexRect", "Billboard texture mapping rect.", PROP_VECTOR4);
    definition->setFieldNames("U1","V1","U2","V2");
    
    PROPERTY(sCount2 + "::position", Ogre::Vector3  , Ogre::Vector3::ZERO, count, SETTER(Ogre::Vector3, CBillboardSetEditor, _setBillboardPosition)); 
    PROPERTY(sCount2 + "::dimensions", Ogre::Vector2, Ogre::Vector2(mDefaultWidth->get(),mDefaultHeight->get()) , count, SETTER(Ogre::Vector2, CBillboardSetEditor, _setBillboardDimensions)); 
    PROPERTY(sCount2 + "::colour", Ogre::ColourValue, Ogre::ColourValue(1,1,1), count, SETTER(Ogre::ColourValue, CBillboardSetEditor, _setBillboardColour)); 
    PROPERTY(sCount2 + "::rotation", Ogre::Real     , 0                  , count, SETTER(Ogre::Real, CBillboardSetEditor, _setBillboardRotation)); 
    PROPERTY(sCount2 + "::texcoordindex", int       , 0                  , count, SETTER(int, CBillboardSetEditor, _setBillboardTexCoordIndex)); 
    PROPERTY(sCount2 + "::texrect", Ogre::Vector4   , Ogre::Vector4::ZERO, count, SETTER(Ogre::Vector4, CBillboardSetEditor, _setBillboardTexRect)); 

    mBillboardCount->set(mBillboardCount->get() + 1);
}
コード例 #2
0
//-----------------------------------------------------------------------------------------
void CEntityEditor::createProperties(OgitorsPropertyValueMap &params)
{
    PROPERTY_PTR(mMeshFile    , "meshfile"    , Ogre::String,""   ,0, SETTER(Ogre::String, CEntityEditor, _setMeshFile));
    PROPERTY_PTR(mCastShadows , "castshadows" , bool        ,false,0, SETTER(bool, CEntityEditor, _setCastShadows));
    PROPERTY_PTR(mSubEntityCount, "subentitycount", int     , -1  ,0, 0);
    PROPERTY_PTR(mRenderingDistance, "renderingdistance",Ogre::Real     ,5000,0, SETTER(Ogre::Real, CEntityEditor, _setRenderingDistance));

    int count = 0;
    OgitorsPropertyValueMap::const_iterator it = params.find("subentitycount");
    if(it != params.end())
        count = Ogre::any_cast<int>(it->second.val);

    OgitorsPropertyDef *definition;
    for(int ix = 0; ix < count; ix++)
    {
        Ogre::String sCount1 = "SubEntities::SubEntity" + Ogre::StringConverter::toString(ix);
        Ogre::String sCount2 = "subentity" + Ogre::StringConverter::toString(ix);
        definition = mFactory->AddPropertyDefinition(sCount2 + "::material", sCount1 + "::Material", "Sub Entity's Material Name", PROP_STRING, true, true);
        definition->setOptions(OgitorsRoot::GetMaterialNames());
        mFactory->AddPropertyDefinition(sCount2 + "::visible", sCount1 + "::Visible", "Sub Entity's Visibility", PROP_BOOL, true, true);
        PROPERTY(sCount2 + "::material", Ogre::String, "", ix, SETTER(Ogre::String, CEntityEditor, _setSubMaterial));
        PROPERTY(sCount2 + "::visible", bool, true, ix, SETTER(bool, CEntityEditor, _setSubVisible));
    }

    mProperties.initValueMap(params);

    Ogre::String addstr = mMeshFile->get();
    int ret = addstr.find(".mesh");
    if(ret != -1)
    {
        addstr.erase(ret, 5);
        mMeshFile->init(addstr);
    }
}
コード例 #3
0
//-----------------------------------------------------------------------------------------
//------CMATERIALEDITORFACTORY-----------------------------------------------------------------
//-----------------------------------------------------------------------------------------
CPGInstanceManagerFactory::CPGInstanceManagerFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "PGInstance Manager Object";
    mEditorType = ETYPE_CUSTOM_MANAGER;
    mAddToObjectList = false;
    mRequirePlacement = false;
    mIcon = "Icons/pagedgeometry.svg";
    mCapabilities = CAN_UNDO | CAN_DELETE;

    OgitorsPropertyDef *definition = AddPropertyDefinition("model", "Model", "The model to be used.", PROP_STRING);
    definition->setOptions(OgitorsRoot::getSingletonPtr()->GetModelNames());
    AddPropertyDefinition("pagesize", "Page Size", "Size of batch pages.",PROP_INT);
    AddPropertyDefinition("batchdistance", "Batch Distance", "Batch Distance.",PROP_INT);
    AddPropertyDefinition("impostordistance", "Impostor Distance", "Impostor Distance.",PROP_INT);
    definition = AddPropertyDefinition("bounds", "Bounds", "The dimensions of the bounding area.",PROP_VECTOR4);
    definition->setFieldNames("X1","Z1","X2","Z2");
    AddPropertyDefinition("castshadows","Cast Shadows","Do the instances cast shadows?",PROP_BOOL);
    AddPropertyDefinition("tempmodified", "", "Is it temporarily modified.", PROP_BOOL);

    AddPropertyDefinition("randomizer::minscale", "Randomizer::Min. Scale", "Minimum Scale of new objects.",PROP_REAL);
    AddPropertyDefinition("randomizer::maxscale", "Randomizer::Max. Scale", "Maximum Scale of new objects.",PROP_REAL);
    AddPropertyDefinition("randomizer::minyaw", "Randomizer::Min. Yaw", "Minimum Yaw of new objects.",PROP_REAL);
    AddPropertyDefinition("randomizer::maxyaw", "Randomizer::Max. Yaw", "Maximum Yaw of new objects.",PROP_REAL);


    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("name");
    it->second.setAccess(true, false);
}
コード例 #4
0
//-------------------------------------------------------------------------------
//----------CPLANEEDITORFACTORY--------------------------------------------------
//-------------------------------------------------------------------------------
CPlaneEditorFactory::CPlaneEditorFactory(OgitorsView *view) : CNodeEditorFactory(view)
{
    mTypeName = "Plane Object";
    mEditorType = ETYPE_MOVABLE;
    mAddToObjectList = true;
    mRequirePlacement = true;
    mIcon = "Icons/plane.svg";
    mCapabilities = CAN_PAGE | CAN_MOVE | CAN_SCALE | CAN_ROTATE | CAN_CLONE | CAN_DELETE  | CAN_FOCUS | CAN_DRAG | CAN_UNDO | CAN_USEMATERIAL | CAN_ACCEPTCOPY;

    AddPropertyDefinition("normal","Normal","The normal of the object.",PROP_VECTOR3);
    AddPropertyDefinition("distance","Distance","The distance of the object.",PROP_REAL);
    AddPropertyDefinition("width","Width","The width of the object.",PROP_REAL);
    AddPropertyDefinition("height","Height","The height of the object.",PROP_REAL);
    AddPropertyDefinition("xsegments","X Segments","The xSegments of the plane.",PROP_INT);
    AddPropertyDefinition("ysegments","Y Segments","The ySegments of the plane.",PROP_INT);
    AddPropertyDefinition("numcoordsets","Num. Coord. Sets","The number of coord sets of the object.",PROP_INT);
    AddPropertyDefinition("utile","U Tile","The uTiling of the object.",PROP_INT);
    AddPropertyDefinition("vtile","V Tile","The vTiling of the object.",PROP_INT);
    AddPropertyDefinition("hasnormals","Has Normals","Does the object has normals?",PROP_BOOL);

    OgitorsPropertyDef *definition;
    
    definition = AddPropertyDefinition("material","Material","The material of the object.",PROP_STRING);
    definition->setOptions(OgitorsRoot::GetMaterialNames());

    AddPropertyDefinition("castshadows","Cast Shadows","Does the object cast shadows?",PROP_BOOL);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("layer");
    it->second.setAccess(true, true);
}
コード例 #5
0
//-----------------------------------------------------------------------------------------
void CTerrainGroupEditor::prepareBeforePresentProperties()
{
    OgitorsPropertyDef *definition;

    definition = const_cast<OgitorsPropertyDef *>(mProperties.getProperty("lightmap::texturesize")->getDefinition());
    definition->setAccess(true, mChildren.size() == 0);
    definition = const_cast<OgitorsPropertyDef *>(mProperties.getProperty("blendmap::texturesize")->getDefinition());
    definition->setAccess(true, mChildren.size() == 0);
    definition = const_cast<OgitorsPropertyDef *>(mProperties.getProperty("pg::densitymapsize")->getDefinition());
    definition->setAccess(true, mChildren.size() == 0);
    definition = const_cast<OgitorsPropertyDef *>(mProperties.getProperty("materialgeneratortype")->getDefinition());
    definition->setAccess(true, mChildren.size() == 0);
}
コード例 #6
0
//-----------------------------------------------------------------------------------------
bool CEntityEditor::load(bool async)
{
    if(mLoaded->get())
        return true;

    if(CNodeEditor::load())
    {
        CSceneManagerEditor *mSceneMgr = mOgitorsRoot->GetSceneManagerEditor();

        try
        {
            mEntityHandle = mOgitorsRoot->GetSceneManager()->createEntity(mName->get(), mMeshFile->get() + ".mesh");
            mUsingPlaceHolderMesh = false;
        }
        catch(...)
        {
            mUsingPlaceHolderMesh = true;
            mEntityHandle = mOgitorsRoot->GetSceneManager()->createEntity(mName->get(), "missing_mesh.mesh");
            mEntityHandle->setMaterialName("MAT_GIZMO_X_L");
        }

        mHandle->attachObject(mEntityHandle);
        mEntityHandle->setQueryFlags(QUERYFLAG_MOVABLE);
        mEntityHandle->setCastShadows(mCastShadows->get());
        mEntityHandle->setVisibilityFlags(1 << mLayer->get());
        mEntityHandle->setRenderingDistance(mRenderingDistance->get());

        OgitorsPropertyDef *definition;
        if(mSubEntityCount->get() == -1)
        {
            int count = mEntityHandle->getNumSubEntities();
            mSubEntityCount->set(count);
            for(int ix = 0; ix < count; ix++)
            {
                Ogre::String sCount1 = "SubEntities::SubEntity" + Ogre::StringConverter::toString(ix);
                Ogre::String sCount2 = "subentity" + Ogre::StringConverter::toString(ix);
                definition = mFactory->AddPropertyDefinition(sCount2 + "::material", sCount1 + "::Material", "Sub Entity's Material Name", PROP_STRING, true, true);
                definition->setOptions(OgitorsRoot::GetMaterialNames());
                mFactory->AddPropertyDefinition(sCount2 + "::visible", sCount1 + "::Visible", "Sub Entity's Visibility", PROP_BOOL, true, true);
                PROPERTY(sCount2 + "::material", Ogre::String, mEntityHandle->getSubEntity(ix)->getMaterialName(), ix, SETTER(Ogre::String, CEntityEditor, _setSubMaterial));
                PROPERTY(sCount2 + "::visible", bool, mEntityHandle->getSubEntity(ix)->isVisible(), ix, SETTER(bool, CEntityEditor, _setSubVisible));

                if(mSceneMgr->getShadowsEnabled())
                {
                    Ogre::MaterialPtr matEnt = Ogre::MaterialManager::getSingletonPtr()->getByName(mEntityHandle->getSubEntity(ix)->getMaterialName());
                    mEntityHandle->getSubEntity(ix)->setMaterial(mSceneMgr->buildDepthShadowMaterial(matEnt));
                }
            }
        }
        else if(!mUsingPlaceHolderMesh)
コード例 #7
0
//-------------------------------------------------------------------------------
//--------------CPARTICLEEDITORFACTORY-------------------------------------------
//-------------------------------------------------------------------------------
CParticleEditorFactory::CParticleEditorFactory(OgitorsView *view) : CNodeEditorFactory(view)
{
    mTypeName = "Particle Object";
    mEditorType = ETYPE_PARTICLE;
    mAddToObjectList = true;
    mRequirePlacement = true;
    mIcon = "Icons/particle.svg";
    mCapabilities = CAN_PAGE | CAN_MOVE | CAN_SCALE | CAN_ROTATE | CAN_CLONE | CAN_DELETE  | CAN_FOCUS | CAN_DRAG | CAN_UNDO | CAN_ACCEPTCOPY;

    OgitorsPropertyDef *definition;
    definition = AddPropertyDefinition("particle","Particle System","The particle name of the object.",PROP_STRING);
    definition->setOptions(OgitorsRoot::GetParticleTemplateNames());
    AddPropertyDefinition("castshadows","Cast Shadows","Does the object cast shadows?",PROP_BOOL);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("layer");
    it->second.setAccess(true, true);
}
コード例 #8
0
ファイル: LightEditor.cpp プロジェクト: xubingyue/Ogitor
//-----------------------------------------------------------------------------------------
//---------CLIGHTEDITORFACTORY-------------------------------------------------------------
//-----------------------------------------------------------------------------------------
CLightEditorFactory::CLightEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "Light";
    mEditorType = ETYPE_LIGHT;
    mAddToObjectList = true;
    mRequirePlacement = true;
    mIcon = "light.svg";
    mCapabilities = CAN_MOVE | CAN_ROTATE | CAN_CLONE | CAN_DELETE  | CAN_FOCUS | CAN_DRAG | CAN_UNDO | CAN_ACCEPTCOPY;
    mUsesGizmos = true;
    mUsesHelper = true;

    mLightTypes.clear();
    mLightTypes.push_back(PropertyOption("LT_POINT",Ogre::Any((int)Ogre::Light::LT_POINT)));
    mLightTypes.push_back(PropertyOption("LT_DIRECTIONAL",Ogre::Any((int)Ogre::Light::LT_DIRECTIONAL)));
    mLightTypes.push_back(PropertyOption("LT_SPOTLIGHT",Ogre::Any((int)Ogre::Light::LT_SPOTLIGHT)));

    OgitorsPropertyDef *definition;

    AddPropertyDefinition("position", "Position", "The position of the object.",PROP_VECTOR3);
    AddPropertyDefinition("orientation","Orientation", "The orientation of the object.",PROP_QUATERNION, true, false);
    AddPropertyDefinition("direction", "Direction", "The direction of the object.",PROP_VECTOR3);
    
    definition = AddPropertyDefinition("lighttype", "Light Type", "The light object's type.",PROP_INT);
    definition->setOptions(&mLightTypes);
    AddPropertyDefinition("diffuse", "Diffuse", "The light object's diffuse colour.",PROP_COLOUR);
    AddPropertyDefinition("specular", "Specular", "The light object's specular colour.",PROP_COLOUR);

    definition = AddPropertyDefinition("lightrange", "Range", "The light object's range.",PROP_VECTOR3);
    definition->setFieldNames("InnerAngle", "OuterAngle", "Falloff");

    definition = AddPropertyDefinition("attenuation", "Attenuation", "The light object's attenuation.",PROP_VECTOR4);
    definition->setFieldNames("Distance", "Constant Mult.", "Linear Mult.", "Quadratic Mult.");

    AddPropertyDefinition("power", "Power", "The light object's power.",PROP_REAL);
    AddPropertyDefinition("castshadows", "Cast Shadows", "Does the object cast shadows?",PROP_BOOL);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("updatescript");
    it->second.setAccess(true, true);
}
コード例 #9
0
//----------------------------------------------------------------------------
//----HYDRAXEDITORFACTORY-----------------------------------------------------
//----------------------------------------------------------------------------
CSkyxEditorFactory::CSkyxEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "Skyx Object";
    mEditorType = ETYPE_SKY_MANAGER;
    mAddToObjectList = true;
    mIcon = "Icons/caelum.svg";
    mCapabilities = CAN_DELETE;

    AddPropertyDefinition("timemultiplier","Time Mult.","",PROP_REAL);
    AddPropertyDefinition("options::rayleighmultiplier","Options::Rayleigh Mult.","",PROP_REAL);
    AddPropertyDefinition("options::miemultiplier","Options::Mie Mult.","",PROP_REAL);
    AddPropertyDefinition("options::samplecount","Options::Sample Count","",PROP_INT);
    AddPropertyDefinition("options::height","Options::Height","",PROP_REAL);
    AddPropertyDefinition("options::exposure","Options::Exposure","",PROP_REAL);
    AddPropertyDefinition("options::innerradius","Options::Inner Radius","",PROP_REAL);
    AddPropertyDefinition("options::outerradius","Options::Outer Radius","",PROP_REAL);

    OgitorsPropertyDef * definition = AddPropertyDefinition("options::time","Options::Time","",PROP_VECTOR3);
    definition->setFieldNames("Current", "Sun Rise", "Sun Set");
    AddPropertyDefinition("options::eastposition","Options::East Position","",PROP_VECTOR2);
    AddPropertyDefinition("options::sunintensity","Options::Sun Intensity","",PROP_REAL);
    definition = AddPropertyDefinition("options::wavelength","Options::Wave Length","",PROP_VECTOR3);
    definition->setFieldNames("R Mult.", "G Mult.", "B Mult.");
    AddPropertyDefinition("options::g","Options::G","",PROP_REAL);


    AddPropertyDefinition("vclouds::noisescale","VClouds::Noise Scale","",PROP_REAL);
    AddPropertyDefinition("vclouds::windspeed","VClouds::Wind Speed","",PROP_REAL);
    AddPropertyDefinition("vclouds::winddirection","VClouds::Wind Direction","",PROP_REAL);


    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("name");
    it->second.setAccess(true, false);

    it = mPropertyDefs.find("layer");
    it->second.setAccess(false, false);
}
コード例 #10
0
//--------------------------------------------------------------------------------------------------
//-----CAELUMEDITORFACTORY--------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
CCaelumEditorFactory::CCaelumEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "Caelum Object";
    mEditorType = ETYPE_SKY_MANAGER;
    mAddToObjectList = true;
    mIcon = "Icons/caelum.svg";
    mCapabilities = CAN_DELETE;

    mMonths.clear();
    mMonths.push_back(PropertyOption("January",Ogre::Any((int)1)));
    mMonths.push_back(PropertyOption("Febuary",Ogre::Any((int)2)));
    mMonths.push_back(PropertyOption("March",Ogre::Any((int)3)));
    mMonths.push_back(PropertyOption("April",Ogre::Any((int)4)));
    mMonths.push_back(PropertyOption("May",Ogre::Any((int)5)));
    mMonths.push_back(PropertyOption("June",Ogre::Any((int)6)));
    mMonths.push_back(PropertyOption("July",Ogre::Any((int)7)));
    mMonths.push_back(PropertyOption("August",Ogre::Any((int)8)));
    mMonths.push_back(PropertyOption("September",Ogre::Any((int)9)));
    mMonths.push_back(PropertyOption("October",Ogre::Any((int)10)));
    mMonths.push_back(PropertyOption("November",Ogre::Any((int)11)));
    mMonths.push_back(PropertyOption("December",Ogre::Any((int)12)));

    OgitorsPropertyDef *definition;

    AddPropertyDefinition("clock::year","UniversalClock::Date::Year","Specifies the current year",PROP_INT, true, true);
    definition = AddPropertyDefinition("clock::month","UniversalClock::Date::Month","Specifies the current month",PROP_INT, true, true);
    definition->setOptions(&mMonths);
    AddPropertyDefinition("clock::day","UniversalClock::Date::Day","Specifies the current day",PROP_INT, true, true);
    AddPropertyDefinition("clock::hour","UniversalClock::Time::Hour","Specifies the current hour",PROP_INT, true, true);
    AddPropertyDefinition("clock::minute","UniversalClock::Time::Minute","Specifies the current minute",PROP_INT, true, true);
    AddPropertyDefinition("clock::second","UniversalClock::Time::Second","Specifies the current second",PROP_INT, true, true);
    AddPropertyDefinition("clock::speed","UniversalClock::Speed","Specifies the current speed multiplier",PROP_REAL, true, true);

    AddPropertyDefinition("observer::longitude","Observer::Longitude","",PROP_REAL, true, true);
    AddPropertyDefinition("observer::latitude","Observer::Latitude","",PROP_REAL, true, true);

    AddPropertyDefinition("lighting::ensure_single_lightsource","Lighting::SingleLightSource","Force single light",PROP_BOOL, true, true);
    AddPropertyDefinition("lighting::ensure_single_shadowsource","Lighting::SingleShadowSource","Force single shadow source",PROP_BOOL, true, true);
    AddPropertyDefinition("lighting::manage_ambient_light","Lighting::ManageAmbientLight","Manage ambient light",PROP_BOOL, true, true);
    AddPropertyDefinition("lighting::minimum_ambient_light","Lighting::MinimumAmbientLight","Manage ambient light",PROP_COLOUR, true, true);

    AddPropertyDefinition("fog::manage","Fog::Manage","",PROP_BOOL, true, true);
    AddPropertyDefinition("fog::density_multiplier","Fog::DensityMultiplier","",PROP_REAL, true, true);

    AddPropertyDefinition("sun::enable","Sun::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("sun::ambient_multiplier","Sun::AmbientMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("sun::diffuse_multiplier","Sun::DiffuseMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("sun::specular_multiplier","Sun::SpecularMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("sun::auto_disable","Sun::AutoDisable","",PROP_BOOL, true, true);
    AddPropertyDefinition("sun::cast_shadow","Sun::CastShadow","",PROP_BOOL, true, true);
    AddPropertyDefinition("sun::attenuation::distance","Sun::Attenuation::Distance","",PROP_REAL, true, true);
    AddPropertyDefinition("sun::attenuation::constant_multiplier","Sun::Attenuation::ConstantMultiplier","",PROP_REAL, true, true);
    AddPropertyDefinition("sun::attenuation::linear_multiplier","Sun::Attenuation::LinearMultiplier","",PROP_REAL, true, true);
    AddPropertyDefinition("sun::attenuation::quadric_multiplier","Sun::Attenuation::QuadricMultiplier","",PROP_REAL, true, true);

    AddPropertyDefinition("sun::position","Sun::Position","The position of the sun.",PROP_VECTOR3, false, false, false);
    AddPropertyDefinition("sun::colour","Sun::Colour","The colour of the sun.",PROP_COLOUR, false, false, false);
    AddPropertyDefinition("sun::lightcolour","Sun::LightColour","The colour of the sun light.",PROP_COLOUR, false, false, false);

    AddPropertyDefinition("moon::enable","Moon::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("moon::ambient_multiplier","Moon::AmbientMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("moon::diffuse_multiplier","Moon::DiffuseMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("moon::specular_multiplier","Moon::SpecularMultiplier","",PROP_COLOUR, true, true);
    AddPropertyDefinition("moon::auto_disable","Moon::AutoDisable","",PROP_BOOL, true, true);
    AddPropertyDefinition("moon::cast_shadow","Moon::CastShadow","",PROP_BOOL, true, true);
    AddPropertyDefinition("moon::attenuation::distance","Moon::Attenuation::Distance","",PROP_REAL, true, true);
    AddPropertyDefinition("moon::attenuation::constant_multiplier","Moon::Attenuation::ConstantMultiplier","",PROP_REAL, true, true);
    AddPropertyDefinition("moon::attenuation::linear_multiplier","Moon::Attenuation::LinearMultiplier","",PROP_REAL, true, true);
    AddPropertyDefinition("moon::attenuation::quadric_multiplier","Moon::Attenuation::QuadricMultiplier","",PROP_REAL, true, true);

    AddPropertyDefinition("stars::enable","Stars::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("stars::magnitude_scale","Stars::MagnitudeScale","",PROP_REAL, true, true);
    AddPropertyDefinition("stars::mag0_pixel_size","Stars::Mag0PixelSize","",PROP_REAL, true, true);
    AddPropertyDefinition("stars::min_pixel_size","Stars::MinPixelSize","",PROP_REAL, true, true);
    AddPropertyDefinition("stars::max_pixel_size","Stars::MinPixelSize","",PROP_REAL, true, true);

    AddPropertyDefinition("clouds::layer0::enable","Clouds::Layer0::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("clouds::layer0::coverage","Clouds::Layer0::Coverage","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer0::height","Clouds::Layer0::Height","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer0::speed","Clouds::Layer0::Speed","",PROP_VECTOR2, true, true);

    AddPropertyDefinition("clouds::layer1::enable","Clouds::Layer1::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("clouds::layer1::coverage","Clouds::Layer1::Coverage","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer1::height","Clouds::Layer1::Height","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer1::speed","Clouds::Layer1::Speed","",PROP_VECTOR2, true, true);

    AddPropertyDefinition("clouds::layer2::enable","Clouds::Layer2::Enable","",PROP_BOOL, true, true);
    AddPropertyDefinition("clouds::layer2::coverage","Clouds::Layer2::Coverage","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer2::height","Clouds::Layer2::Height","",PROP_REAL, true, true);
    AddPropertyDefinition("clouds::layer2::speed","Clouds::Layer2::Speed","",PROP_VECTOR2, true, true);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("name");
    it->second.setAccess(true, false);

    it = mPropertyDefs.find("layer");
    it->second.setAccess(false, false);
}
コード例 #11
0
//-----------------------------------------------------------------------------------------
//------CTERRAINGROUPEDITORFACTORY---------------------------------------------------------
//-----------------------------------------------------------------------------------------
CTerrainGroupEditorFactory::CTerrainGroupEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "Terrain Group";
    mEditorType = ETYPE_TERRAIN_MANAGER;
    mAddToObjectList = true;
    mIcon = "pagedterrainmanager.svg";
    mCapabilities = CAN_DELETE | CAN_UNDO;
    mUsesGizmos = false;
    mUsesHelper = false;

    mMinBatchSizes.clear();
    mMinBatchSizes.push_back(PropertyOption("5", Ogre::Any((int)5)));
    mMinBatchSizes.push_back(PropertyOption("9", Ogre::Any((int)9)));
    mMinBatchSizes.push_back(PropertyOption("17", Ogre::Any((int)17)));
    mMinBatchSizes.push_back(PropertyOption("33", Ogre::Any((int)33)));

    mMaxBatchSizes.clear();
    mMaxBatchSizes.push_back(PropertyOption("33", Ogre::Any((int)33)));
    mMaxBatchSizes.push_back(PropertyOption("65", Ogre::Any((int)65)));
    mMaxBatchSizes.push_back(PropertyOption("129", Ogre::Any((int)129)));

    mMapSizeOptions.clear();
    mMapSizeOptions.push_back(PropertyOption("128x128", Ogre::Any((int)129)));
    mMapSizeOptions.push_back(PropertyOption("256x256", Ogre::Any((int)257)));
    mMapSizeOptions.push_back(PropertyOption("512x512", Ogre::Any((int)513)));
    mMapSizeOptions.push_back(PropertyOption("1024x1024", Ogre::Any((int)1025)));

    mColourMapSizeOptions.clear();
    mColourMapSizeOptions.push_back(PropertyOption("128x128", Ogre::Any((int)128)));
    mColourMapSizeOptions.push_back(PropertyOption("256x256", Ogre::Any((int)256)));
    mColourMapSizeOptions.push_back(PropertyOption("512x512", Ogre::Any((int)512)));
    mColourMapSizeOptions.push_back(PropertyOption("1024x1024", Ogre::Any((int)1024)));
    mColourMapSizeOptions.push_back(PropertyOption("2048x2048", Ogre::Any((int)2048)));

    mMaterialGeneratorTypes.clear();
    mMaterialGeneratorTypes.push_back(PropertyOption("Default", Ogre::Any((int)0)));
    mMaterialGeneratorTypes.push_back(PropertyOption("Ogitor10", Ogre::Any((int)1)));

    AddPropertyDefinition("pageworldsize","World Size", "The size of page in world coordinates.",PROP_REAL);
    OgitorsPropertyDef *definition = AddPropertyDefinition("pagemapsize","Map Size", "The size of page in vertices per side.",PROP_INT);
    definition->setOptions(&mMapSizeOptions);
    AddPropertyDefinition("pagenameprefix","Page Name Prefix", "The Prefix to be added to page names.",PROP_STRING);
    definition = AddPropertyDefinition("materialgeneratortype","Mat. Generator", "The material generator to be used.",PROP_INT);
    definition->setOptions(&mMaterialGeneratorTypes);
    definition = AddPropertyDefinition("lightmap::texturesize","Light Map::Texture Size", "The size of lightmap texture.",PROP_INT);
    definition->setOptions(&mColourMapSizeOptions);
    definition = AddPropertyDefinition("blendmap::texturesize","Blend Map::Texture Size", "The size of blendmap texture.",PROP_INT);
    definition->setOptions(&mColourMapSizeOptions);
    definition = AddPropertyDefinition("tuning::compositemaptexturesize","Tuning::Composite Map Size", "The size of compositemap texture.",PROP_INT);
    definition->setOptions(&mColourMapSizeOptions);
    AddPropertyDefinition("colourmap::enabled","Colour Map::Enabled", "Is the colourmap enabled?",PROP_BOOL);
    definition = AddPropertyDefinition("colourmap::texturesize","Colour Map::Texture Size", "The size of colourmap texture.",PROP_INT);
    definition->setOptions(&mColourMapSizeOptions);

    AddPropertyDefinition("tuning::compositemapdistance","Tuning::Composite Map Dist.", "The distance at which composite map will be used for terrain texturing", PROP_INT);
    AddPropertyDefinition("tuning::maxpixelerror","Tuning::Max Pixel Error", "Maximum Pixel Error for LOD", PROP_INT);
    definition = AddPropertyDefinition("tuning::minbatchsize","Tuning::Min Batch Size", "Minimum Batch Size.",PROP_INT);
    definition->setOptions(&mMinBatchSizes);
    definition = AddPropertyDefinition("tuning::maxbatchsize","Tuning::Max Batch Size", "Maximum Batch Size.",PROP_INT);
    definition->setOptions(&mMaxBatchSizes);
    AddPropertyDefinition("tuning::skirtsize","Tuning::Skirt Size", "Skirt Size.",PROP_INT);
    AddPropertyDefinition("tuning::userayboxdistancecalculation","Tuning::Adv. Dist. Calc.", "Use Ray Box Distance Calculation for LOD.",PROP_BOOL);

    definition = AddPropertyDefinition("pg::densitymapsize","Paged Grass::Density Map Size", "", PROP_INT);
    definition->setOptions(&mColourMapSizeOptions);
    AddPropertyDefinition("pg::pagesize","Paged Grass::Page Size", "", PROP_INT);
    AddPropertyDefinition("pg::detaildistance","Paged Grass::Detail Distance", "", PROP_INT);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("name");
    it->second.setAccess(true, false);
}
コード例 #12
0
ファイル: SkyxEditor.cpp プロジェクト: jacmoe/ogitor
//----------------------------------------------------------------------------
//----SKYXEDITORFACTORY-----------------------------------------------------
//----------------------------------------------------------------------------
CSkyxEditorFactory::CSkyxEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName           = "Skyx";
    mEditorType         = ETYPE_SKY_MANAGER;
    mAddToObjectList    = true;
    mIcon               = "caelum.svg";
    mCapabilities       = CAN_DELETE;
    mUsesGizmos = false;
    mUsesHelper = false;

    OgitorsPropertyDef* definition = 0;
    definition = AddPropertyDefinition("options::currenttime",          "Options::Current Time",        "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(24.0f), Ogre::Any(0.25f));
    definition->setTrackChanges(false);
    definition = AddPropertyDefinition("options::time",                 "Options::Day Time",            "", PROP_VECTOR2);
    definition->setFieldNames("Sun Rise", "Sun Set");
    definition->setRange(Ogre::Any(Ogre::Vector2(0, 0)), Ogre::Any(Ogre::Vector2(24, 24)), Ogre::Any(Ogre::Vector2(0.25f, 0.25f)));
    definition = AddPropertyDefinition("options::timemultiplier",       "Options::Time Mult.",          "", PROP_REAL);
    definition->setRange(Ogre::Any(-1000.0f), Ogre::Any(1000.0f), Ogre::Any(0.25f));
    definition = AddPropertyDefinition("options::miemultiplier",        "Options::Mie Mult.",           "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(1.0f), Ogre::Any(0.00025f));
    definition = AddPropertyDefinition("options::rayleighmultiplier",   "Options::Rayleigh Mult.",      "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(1.0f), Ogre::Any(0.00025f));
    definition = AddPropertyDefinition("options::innerradius",          "Options::Inner Radius",        "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(1e9f), Ogre::Any(0.5f));
    definition = AddPropertyDefinition("options::outerradius",          "Options::Outer Radius",        "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(1e9f), Ogre::Any(0.5f));
    definition = AddPropertyDefinition("options::samplecount",          "Options::Sample Count",        "", PROP_INT);
    definition = AddPropertyDefinition("options::height",               "Options::Height",              "", PROP_REAL);
    definition->setStepSize(Ogre::Any(0.05f));
    definition =AddPropertyDefinition("options::exposure",              "Options::Exposure",            "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(15.0f), Ogre::Any(0.25f));
    definition = AddPropertyDefinition("options::eastposition",         "Options::East Position",       "", PROP_VECTOR2);
    definition = AddPropertyDefinition("options::sunintensity",         "Options::Sun Intensity",       "", PROP_REAL);
    definition = AddPropertyDefinition("options::wavelength",           "Options::Wave Length",         "", PROP_COLOUR);
    definition = AddPropertyDefinition("options::g",                    "Options::Phase Function",      "", PROP_REAL);
    definition->setRange(Ogre::Any(-1.0f), Ogre::Any(0.0f), Ogre::Any(0.00025f));
    definition = AddPropertyDefinition("options::moonphase",            "Moon::Moon Phase",             "", PROP_REAL);
    definition->setRange(Ogre::Any(-1.0f), Ogre::Any(1.0f), Ogre::Any(0.02f));

    // SkyX Moon parameters
    definition = AddPropertyDefinition("options::moonsize",             "Moon::Moon Size",              "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(1.0f), Ogre::Any(0.05f));
    definition = AddPropertyDefinition("options::moonhalointensity",    "Moon::Halo Intesity",          "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(5.0f), Ogre::Any(0.1f));
    definition = AddPropertyDefinition("options::moonhalostrength",     "Moon::Halo Strength",          "", PROP_REAL);
    definition->setRange(Ogre::Any(0.1f), Ogre::Any(3.0f), Ogre::Any(0.01f)); 

    // SkyX Volumetric Clouds
    AddPropertyDefinition("vclouds::enable",                            "Volumetric Clouds::Enable",            "", PROP_BOOL);
    AddPropertyDefinition("vclouds::autoupdate",                        "Volumetric Clouds::Auto Update",       "", PROP_BOOL);
    definition = AddPropertyDefinition("vclouds::cloudscale",           "Volumetric Clouds::Cloud Scale",       "", PROP_REAL);
    definition->setRange(Ogre::Any(0.1f), Ogre::Any(10.0f), Ogre::Any(0.1f));
    definition = AddPropertyDefinition("vclouds::noisescale",           "Volumetric Clouds::Noise Scale",       "", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(20.0f), Ogre::Any(0.25f));
    definition = AddPropertyDefinition("vclouds::windspeed",            "Volumetric Clouds::Wind Speed",        "", PROP_INT);
    definition->setRange(Ogre::Any(0), Ogre::Any(10000), Ogre::Any(25));
    definition = AddPropertyDefinition("vclouds::winddirection",        "Volumetric Clouds::Wind Direction",    "", PROP_INT);
    definition->setRange(Ogre::Any(0), Ogre::Any(360), Ogre::Any(10));
    definition = AddPropertyDefinition("vclouds::ambientcolor",         "Volumetric Clouds::Ambient Color",     "", PROP_COLOUR);
    definition = AddPropertyDefinition("vclouds::lightresponse",        "Volumetric Clouds::Light Response",    "", PROP_VECTOR4);
    definition->setFieldNames("Sun light power", "Sun beta multiplier", "Ambient color multiplier", "Distance attenuation");
    definition->setRange(Ogre::Any(Ogre::Vector4(0.0f)), Ogre::Any(Ogre::Vector4(5.0f)), Ogre::Any(Ogre::Vector4(0.02f)));
    definition = AddPropertyDefinition("vclouds::ambientfactors",       "Volumetric Clouds::Ambient Factors",   "", PROP_VECTOR4);
    definition->setFieldNames("Constant", "Linear", "Quadratic", "Cubic");    
    definition->setRange(Ogre::Any(Ogre::Vector4(0.0f)), Ogre::Any(Ogre::Vector4(5.0f)), Ogre::Any(Ogre::Vector4(0.02f)));
    definition = AddPropertyDefinition("vclouds::weather",              "Volumetric Clouds::Weather",           "", PROP_VECTOR2);
    definition->setFieldNames("Humidity", "Average Cloud Size");
    definition->setRange(Ogre::Any(Ogre::Vector2(0, 0)), Ogre::Any(Ogre::Vector2(1, 1)), Ogre::Any(Ogre::Vector2(0.1, 0.1)));
    
    // SkyX Volumetric Clouds Lightning
    definition = AddPropertyDefinition("vclightning::enable",           "Lightning::Enable",                    "", PROP_BOOL);
    definition = AddPropertyDefinition("vclightning::at",               "Lightning::Avg. Aparition Time",       "Average time between lightnings (in seconds)", PROP_REAL);
    definition->setRange(Ogre::Any(0.0f), Ogre::Any(120.0f), Ogre::Any(0.25f));
    definition = AddPropertyDefinition("vclightning::color",            "Lightning::Color",                     "", PROP_COLOUR);
    definition = AddPropertyDefinition("vclightning::tm",               "Lightning::Lightning Time Multiplier", "", PROP_REAL);
    definition->setRange(Ogre::Any(0.1f), Ogre::Any(5.0f), Ogre::Any(0.1f));

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("name");
    it->second.setAccess(true, false);

    it = mPropertyDefs.find("layer");
    it->second.setAccess(false, false);
}
コード例 #13
0
//-------------------------------------------------------------------------------
//--------CSCENEMANAGEREDITORFACTORY---------------------------------------------
//-------------------------------------------------------------------------------
CSceneManagerEditorFactory::CSceneManagerEditorFactory(OgitorsView *view) : CBaseEditorFactory(view)
{
    mTypeName = "OctreeSceneManager";
    mEditorType = ETYPE_SCENEMANAGER;
    mIcon = "Icons/tsm.svg";
    mCapabilities = CAN_DROP | CAN_UNDO | CAN_ACCEPTPASTE;

    mFogModes.clear();
    mFogModes.push_back(PropertyOption("FOG_NONE",Ogre::Any((int)Ogre::FOG_NONE)));
    mFogModes.push_back(PropertyOption("FOG_LINEAR",Ogre::Any((int)Ogre::FOG_LINEAR)));
    mFogModes.push_back(PropertyOption("FOG_EXP",Ogre::Any((int)Ogre::FOG_EXP)));
    mFogModes.push_back(PropertyOption("FOG_EXP2",Ogre::Any((int)Ogre::FOG_EXP2)));

    mTextureMapSizes.clear();
    mTextureMapSizes.push_back(PropertyOption("128x128",Ogre::Any((int)128)));
    mTextureMapSizes.push_back(PropertyOption("256x256",Ogre::Any((int)256)));
    mTextureMapSizes.push_back(PropertyOption("512x512",Ogre::Any((int)512)));
    mTextureMapSizes.push_back(PropertyOption("1024x1024",Ogre::Any((int)1024)));
    mTextureMapSizes.push_back(PropertyOption("2048x2048",Ogre::Any((int)2048)));
    mTextureMapSizes.push_back(PropertyOption("4096x4096",Ogre::Any((int)4096)));

    mShadowTechniqueNames.clear();
    mShadowTechniqueNames.push_back(PropertyOption("NONE",Ogre::Any((int)Ogre::SHADOWTYPE_NONE)));
    mShadowTechniqueNames.push_back(PropertyOption("STENCIL_ADDITIVE",Ogre::Any((int)Ogre::SHADOWTYPE_STENCIL_ADDITIVE)));
    mShadowTechniqueNames.push_back(PropertyOption("STENCIL_MODULATIVE",Ogre::Any((int)Ogre::SHADOWTYPE_STENCIL_MODULATIVE)));
    mShadowTechniqueNames.push_back(PropertyOption("TEXTURE_ADDITIVE",Ogre::Any((int)Ogre::SHADOWTYPE_TEXTURE_ADDITIVE)));
    mShadowTechniqueNames.push_back(PropertyOption("TEXTURE_ADDITIVE_INTEGRATED",Ogre::Any((int)Ogre::SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED)));
    mShadowTechniqueNames.push_back(PropertyOption("TEXTURE_MODULATIVE",Ogre::Any((int)Ogre::SHADOWTYPE_TEXTURE_MODULATIVE)));
    mShadowTechniqueNames.push_back(PropertyOption("TEXTURE_MODULATIVE_INTEGRATED",Ogre::Any((int)Ogre::SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED)));

    AddPropertyDefinition("scenemanagertype","Manager Type","The typename of the Scene Manager.",PROP_STRING, true, false);
    AddPropertyDefinition("configfile","Config File","The configuration file of the object.",PROP_STRING,true,false);
    AddPropertyDefinition("ambient","Ambient","The ambient colour of the scene.",PROP_COLOUR);
    
    OgitorsPropertyDef *definition = AddPropertyDefinition("skybox::material","SkyBox::Material","The material of the skybox.",PROP_STRING);
    definition->setOptions(OgitorsRoot::GetSkyboxMaterials());
    AddPropertyDefinition("skybox::active","SkyBox::Active","Is the skybox active?",PROP_BOOL);
    AddPropertyDefinition("skybox::distance","SkyBox::Distance","The distance of the skybox.",PROP_REAL);
    
    definition = AddPropertyDefinition("skydome::material","SkyDome::Material","The material of the skydome.",PROP_STRING);
    definition->setOptions(OgitorsRoot::GetSkyboxMaterials());
    AddPropertyDefinition("skydome::active","SkyDome::Active","Is the skydome active?",PROP_BOOL);

    definition = AddPropertyDefinition("fog::mode","Fog::Mode","The fog mode of the scene.",PROP_INT);
    definition->setOptions(&mFogModes);

    AddPropertyDefinition("fog::colour","Fog::Colour","The colour of the fog.",PROP_COLOUR);
    AddPropertyDefinition("fog::start","Fog::Start","The distance at which fog starts.",PROP_REAL);
    AddPropertyDefinition("fog::end","Fog::End","The distance at which fog ends.",PROP_REAL);
    AddPropertyDefinition("fog::density","Fog::Density","The density of fog.",PROP_REAL);
    AddPropertyDefinition("position","Position","The position of the object.",PROP_VECTOR3, true, false);
    AddPropertyDefinition("scale","Scale","The scale of the object.",PROP_VECTOR3);
    AddPropertyDefinition("orientation","Orientation","The orientation of the object.",PROP_QUATERNION, true, false);
    AddPropertyDefinition("renderingdistance","Rendering Distance","The maximum distance to render meshes.",PROP_REAL);

    AddPropertyDefinition("shadows::enabled","Shadows::Enabled","Enable/Disable Shadows",PROP_BOOL);
    definition = AddPropertyDefinition("shadows::technique","Shadows::Technique","Shadow Technique to use",PROP_INT, true, false);
    definition->setOptions(&mShadowTechniqueNames);
    AddPropertyDefinition("shadows::renderingdistance","Shadows::Rendering Distance","The distance up to which shadows will be rendered",PROP_INT);
    definition = AddPropertyDefinition("shadows::resolutionnear","Shadows::Near Map Res.","Resolution of the nearest shadow map",PROP_INT);
    definition->setOptions(&mTextureMapSizes);
    definition = AddPropertyDefinition("shadows::resolutionmiddle","Shadows::Middle Map Res.","Resolution of the middle shadow map",PROP_INT);
    definition->setOptions(&mTextureMapSizes);
    definition = AddPropertyDefinition("shadows::resolutionfar","Shadows::Far Map Res.","Resolution of the far shadow map",PROP_INT);
    definition->setOptions(&mTextureMapSizes);

    OgitorsPropertyDefMap::iterator it = mPropertyDefs.find("layer");
    it->second.setAccess(false, false);
}