mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
updating game obj frame placement pos upon frame creation
This commit is contained in:
@@ -229,6 +229,13 @@ namespace battleship{
|
|||||||
if(!placingVertically) minDepthCalculated = false;
|
if(!placingVertically) minDepthCalculated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameObjectFrameController::addGameObjectFrame(GameObjectFrame u){
|
||||||
|
gameObjectFrames.push_back(u);
|
||||||
|
vector<RayCaster::CollisionResult> results = Map::getSingleton()->raycastTerrain(u.getPos(), -Vector3::VEC_J, true);
|
||||||
|
|
||||||
|
if(!results.empty()) placementPos = results[0].pos;
|
||||||
|
}
|
||||||
|
|
||||||
void GameObjectFrameController::removeGameObjectFrame(int i){
|
void GameObjectFrameController::removeGameObjectFrame(int i){
|
||||||
gameObjectFrames[i].destroy();
|
gameObjectFrames[i].destroy();
|
||||||
gameObjectFrames.erase(gameObjectFrames.begin() + i);
|
gameObjectFrames.erase(gameObjectFrames.begin() + i);
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ namespace battleship{
|
|||||||
void removeGameObjectFrames();
|
void removeGameObjectFrames();
|
||||||
void rotateGameObjectFrames(float);
|
void rotateGameObjectFrames(float);
|
||||||
void checkPlacement(GameObjectFrame&);
|
void checkPlacement(GameObjectFrame&);
|
||||||
|
void addGameObjectFrame(GameObjectFrame);
|
||||||
inline int getNumGameObjectFrames(){return gameObjectFrames.size();}
|
inline int getNumGameObjectFrames(){return gameObjectFrames.size();}
|
||||||
inline void addGameObjectFrame(GameObjectFrame u){gameObjectFrames.push_back(u);}
|
|
||||||
inline GameObjectFrame& getGameObjectFrame(int i){return gameObjectFrames[i];}
|
inline GameObjectFrame& getGameObjectFrame(int i){return gameObjectFrames[i];}
|
||||||
inline bool isPaintSelecting(){return paintSelecting;}
|
inline bool isPaintSelecting(){return paintSelecting;}
|
||||||
inline void setPaintSelecting(bool ps){paintSelecting = ps;}
|
inline void setPaintSelecting(bool ps){paintSelecting = ps;}
|
||||||
|
|||||||
Reference in New Issue
Block a user