mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
factored out land and water body ray casting
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
#include <mesh.h>
|
||||
#include <model.h>
|
||||
#include <root.h>
|
||||
#include <rayCaster.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -119,13 +118,7 @@ namespace battleship{
|
||||
frame.update();
|
||||
|
||||
Vector3 startPos = Root::getSingleton()->getCamera()->getPosition();
|
||||
vector<RayCaster::CollisionResult> results = RayCaster::cast(
|
||||
startPos,
|
||||
(screenToSpace(getCursorPos()) - startPos).norm(),
|
||||
Map::getSingleton()->getNodeParent()->getChild(0),
|
||||
0,
|
||||
configData::DIST_FROM_RAY
|
||||
);
|
||||
vector<RayCaster::CollisionResult> results = Map::getSingleton()->raycastTerrain(startPos, (screenToSpace(getCursorPos()) - startPos).norm(), true);
|
||||
|
||||
if(results.empty()) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user