Working on minor fixing, working on pathfinding
This commit is contained in:
1 parent
a11c4614ea
commit
c9c6b7e7fb
9 files changed
+290
-47
No files matched your search
+4
-3
@@ -173,8 +173,8 @@ void Character::resetPlayerAfterDeath() {
|
||||
state.attack = 0;
|
||||
}
|
||||
|
||||
void Character::forceReplan() {
|
||||
if (!pathPlanner) return;
|
||||
bool Character::forceReplan() {
|
||||
if (!pathPlanner) return false;
|
||||
|
||||
const Eigen::Vector3f normalizedTarget(state.requestedWalkTarget.x(), 0.f, state.requestedWalkTarget.z());
|
||||
state.pathWaypoints = pathPlanner(state.position, normalizedTarget);
|
||||
@@ -185,12 +185,13 @@ void Character::forceReplan() {
|
||||
waypoint.y() = 0.f;
|
||||
}
|
||||
state.walkTarget = state.pathWaypoints.back();
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
state.walkTarget = Eigen::Vector3f(state.position.x(), 0.f, state.position.z());
|
||||
state.onArrivedCallback = nullptr;
|
||||
state.onArrivedCallbackName.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Character::setTexture(std::shared_ptr<FRG::Texture> texture) {
|
||||
|
||||
Reference in new issue
Block a user