Merge branch 'GarageGames/development' into ueberengine-dev

This commit is contained in:
Duion 2015-08-06 20:05:32 +02:00
commit 683a11e384
273 changed files with 4702 additions and 3631 deletions

View file

@ -97,7 +97,6 @@ void ForestEditorCtrl::onSleep()
bool ForestEditorCtrl::updateActiveForest( bool createNew )
{
mForest = dynamic_cast<Forest*>( Sim::findObject( "theForest" ) );
Con::executef( this, "onActiveForestUpdated", mForest ? mForest->getIdString() : "", createNew ? "1" : "0" );
if ( mTool )
@ -400,4 +399,13 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
{
return object->isDirty();
}
DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )")
{
Forest *forestObject;
if (!Sim::findObject(obj, forestObject))
return;
object->setActiveForest(forestObject);
}

View file

@ -86,6 +86,9 @@ class ForestEditorCtrl : public EditTSCtrl
/// Causes the editor to reselect the active forest.
bool updateActiveForest( bool createNew );
/// Sets the active Forest
void setActiveForest(Forest* forestObject) { mForest = forestObject; }
/// Returns the active Forest.
Forest *getActiveForest() const { return mForest; }

View file

@ -56,7 +56,7 @@ Point3F Selection<ForestItem>::getOrigin()
Selection<ForestItem>::iterator itr = begin();
for ( ; itr != end(); itr++ )
for (; itr != end(); ++itr)
{
const MatrixF &mat = itr->getTransform();
Point3F wPos;
@ -450,10 +450,11 @@ void ForestSelectionTool::onRender2D()
F32 hscale = wwidth * 2 / F32(mEditor->getWidth());
F32 vscale = wheight * 2 / F32(mEditor->getHeight());
F32 left = (mDragRect.point.x - mEditor->getPosition().x) * hscale - wwidth;
F32 right = (mDragRect.point.x - mEditor->getPosition().x + mDragRect.extent.x) * hscale - wwidth;
F32 top = wheight - vscale * (mDragRect.point.y - mEditor->getPosition().y);
F32 bottom = wheight - vscale * (mDragRect.point.y - mEditor->getPosition().y + mDragRect.extent.y);
Point2I editorPosition = mEditor->getPosition();
F32 left = (mDragRect.point.x - editorPosition.x) * hscale - wwidth;
F32 right = (mDragRect.point.x - editorPosition.x + mDragRect.extent.x) * hscale - wwidth;
F32 top = wheight - vscale * (mDragRect.point.y - editorPosition.y);
F32 bottom = wheight - vscale * (mDragRect.point.y - editorPosition.y + mDragRect.extent.y);
gDragFrustum.set(lastCameraQuery.ortho, left, right, top, bottom, lastCameraQuery.nearPlane, lastCameraQuery.farPlane, lastCameraQuery.cameraMatrix );
mForest->getData()->getItems( gDragFrustum, &mDragSelection );