diff --git a/Content/Documentation/ScriptingAPI-Documentation.md b/Content/Documentation/ScriptingAPI-Documentation.md index cda969e3e..5a5ba0e6a 100644 --- a/Content/Documentation/ScriptingAPI-Documentation.md +++ b/Content/Documentation/ScriptingAPI-Documentation.md @@ -668,7 +668,8 @@ A four component floating point vector. Provides efficient calculations with SIM - Slerp(Vector quaternion1,quaternion2, float t) : Vector resultQuaternion -- same as QuaternionSlerp - PlaneFromPointNormal(Vector point, normal) : constructs a plane from a point and a normal - PlaneFromPoints(Vector a,b,c) : constructs a plane from three points -- GetAngle(Vector a,b,axis, opt float max_angle = math.pi * 2) : float result -- computes the signed angle between two 3D vectors around specified axis +- GetAngle(Vector a,b,axis, opt float max_angle = math.pi * 2) : float result -- computes the angle between two 3D vectors around specified axis in range: [0, max_angle] +- GetAngleSigned(Vector a,b,axis) : float result -- computes the signed angle between two 3D vectors around specified axis ### Matrix A four by four matrix, efficient calculations with SIMD support. @@ -1588,6 +1589,7 @@ Implementation of basic character controller features such as movement in the sc - SetWaterFriction(float value) -- velocity multiplier when swimming in water, default: 0.9 - SetSlopeThreshold(float value) -- Slope detection threshold, default: 0.2 - SetLeaningLimit(float value) -- Leaning min/max clamping, default: 0.12 +- SetTurningSpeed(float value) -- Turning smoothing speed when using Turn(), default: 10.0 - SetFixedUpdateFPS(float value) -- Frame rate of simulation, default: 120 - SetGravity(float value) -- Gravity value, default: -30 - SetWaterVerticalOffset(float value) -- vertical offset to keep from water. Useful if character is too submerged in the swimming state @@ -1622,6 +1624,7 @@ Implementation of basic character controller features such as movement in the sc - GetRelativeOffset() : Vector -- returns the relative offset (relative to facing direction) - GetLeaning() : float -- returns immediate leaning amount - GetLeaningSmoothed() : float -- returns smoothed leaning amount +- GetFootOffset() : float -- returns vertical offset that accounts for character's position after foot placements - SetPathGoal(Vector goal, VoxelGrid voxelgrid) -- Set the goal for path finding, it will be processed the next time the scene is updated. You can get the results by accessing the pathquery object of the character with GetPathQuery(). - GetPathQuery() : PathQuery -- returns the PathQuery object of this character diff --git a/Content/scripts/character_controller/character_controller.lua b/Content/scripts/character_controller/character_controller.lua index 6b6d1b964..227303ef1 100644 --- a/Content/scripts/character_controller/character_controller.lua +++ b/Content/scripts/character_controller/character_controller.lua @@ -100,7 +100,6 @@ local function Character(model_scene, start_transform, controllable, anim_scene, position = Vector(), ground_intersect = false, controllable = true, - root_offset = 0, foot_placed_left = false, foot_placed_right = false, mood = Mood.Neutral, @@ -479,6 +478,11 @@ local function Character(model_scene, start_transform, controllable, anim_scene, charactercomponent.SetFacing(facing) charactercomponent.SetWidth(0.3) charactercomponent.SetHeight(1.8) + if controllable then + charactercomponent.SetTurningSpeed(9) + else + charactercomponent.SetTurningSpeed(7) -- Set NPC to turn slower because when we approach it for conversation, fast turning looks bad + end --charactercomponent.SetFootPlacementEnabled(false) local layer = scene.Component_GetLayer(self.model) @@ -664,11 +668,11 @@ local function ThirdPersonCamera(character) self.rest_distance = math.lerp(self.rest_distance, self.rest_distance_new, 0.1) -- lerp will smooth out the zooming -- This will allow some smoothing for certain movements of camera target: - local character_transform = scene.Component_GetTransform(self.character.model) - local character_position = character_transform.GetPosition() + local charactercomponent = scene.Component_GetCharacter(self.character.model) + local character_position = charactercomponent.GetPositionInterpolated() self.target_rot_horizontal = math.lerp(self.target_rot_horizontal, self.character.target_rot_horizontal, 0.1) self.target_rot_vertical = math.lerp(self.target_rot_vertical, self.character.target_rot_vertical, 0.1) - self.target_height = math.lerp(self.target_height, character_position.GetY() + self.character.target_height + self.character.root_offset, 0.1) + self.target_height = math.lerp(self.target_height, character_position.GetY() + self.character.target_height + charactercomponent.GetFootOffset(), 0.1) local camera_transform = scene.Component_GetTransform(self.camera) local target_transform = TransformComponent() diff --git a/WickedEngine/wiLua.cpp b/WickedEngine/wiLua.cpp index 2e6479f29..689d2ee8b 100644 --- a/WickedEngine/wiLua.cpp +++ b/WickedEngine/wiLua.cpp @@ -52,6 +52,24 @@ namespace wi::lua return luainternal; } + wi::Application* editorApplication = nullptr; + wi::RenderPath* editorRenderPath = nullptr; + int IsThisEditor(lua_State* L) + { + bool ret = editorApplication != nullptr && editorRenderPath != nullptr; + wi::lua::SSetBool(L, ret); + return 1; + } + int ReturnToEditor(lua_State* L) + { + if (editorApplication != nullptr && editorRenderPath != nullptr) + { + KillProcesses(); + editorApplication->ActivatePath(editorRenderPath); + } + return 0; + } + void PostErrorMsg(lua_State* L) { const char* str = lua_tostring(L, -1); @@ -64,6 +82,8 @@ namespace wi::lua ss += str; wi::backlog::post(ss, wi::backlog::LogLevel::Error); lua_pop(L, 1); // remove error message + + ReturnToEditor(L); } void PostErrorMsg() @@ -201,24 +221,6 @@ namespace wi::lua return 0; } - wi::Application* editorApplication = nullptr; - wi::RenderPath* editorRenderPath = nullptr; - int IsThisEditor(lua_State* L) - { - bool ret = editorApplication != nullptr && editorRenderPath != nullptr; - wi::lua::SSetBool(L, ret); - return 1; - } - int ReturnToEditor(lua_State* L) - { - if (editorApplication != nullptr && editorRenderPath != nullptr) - { - KillProcesses(); - editorApplication->ActivatePath(editorRenderPath); - } - return 0; - } - int IsThisDebugBuild(lua_State* L) { #ifdef _DEBUG @@ -636,6 +638,8 @@ namespace wi::lua ss += error; } wi::backlog::post(ss, wi::backlog::LogLevel::Error); + + ReturnToEditor(L); } bool CompileFile(const char* filename, wi::vector& dst) diff --git a/WickedEngine/wiMath.cpp b/WickedEngine/wiMath.cpp index b230bdb78..1df154cbb 100644 --- a/WickedEngine/wiMath.cpp +++ b/WickedEngine/wiMath.cpp @@ -121,6 +121,15 @@ namespace wi::math } return angle; } + float GetAngleSigned(XMVECTOR A, XMVECTOR B, XMVECTOR AXIS) + { + float angle = XMVectorGetX(XMVector3AngleBetweenVectors(A, B)); + if (XMVectorGetX(XMVector3Dot(XMVector3Cross(A, B), AXIS)) < 0) + { + angle = -angle; + } + return angle; + } void ConstructTriangleEquilateral(float radius, XMFLOAT4& A, XMFLOAT4& B, XMFLOAT4& C) { float deg = 0; diff --git a/WickedEngine/wiMath.h b/WickedEngine/wiMath.h index 276279d1e..4521be064 100644 --- a/WickedEngine/wiMath.h +++ b/WickedEngine/wiMath.h @@ -413,6 +413,7 @@ namespace wi::math float GetAngle(const XMFLOAT2& a, const XMFLOAT2& b); float GetAngle(const XMFLOAT3& a, const XMFLOAT3& b, const XMFLOAT3& axis, float max = XM_2PI); float GetAngle(XMVECTOR A, XMVECTOR B, XMVECTOR axis, float max = XM_2PI); + float GetAngleSigned(XMVECTOR A, XMVECTOR B, XMVECTOR axis); void ConstructTriangleEquilateral(float radius, XMFLOAT4& A, XMFLOAT4& B, XMFLOAT4& C); void GetBarycentric(const XMVECTOR& p, const XMVECTOR& a, const XMVECTOR& b, const XMVECTOR& c, float &u, float &v, float &w, bool clamp = false); diff --git a/WickedEngine/wiMath_BindLua.cpp b/WickedEngine/wiMath_BindLua.cpp index ef9414d14..d18cf5bd1 100644 --- a/WickedEngine/wiMath_BindLua.cpp +++ b/WickedEngine/wiMath_BindLua.cpp @@ -39,6 +39,7 @@ namespace wi::lua lunamethod(Vector_BindLua, PlaneFromPointNormal), lunamethod(Vector_BindLua, PlaneFromPoints), lunamethod(Vector_BindLua, GetAngle), + lunamethod(Vector_BindLua, GetAngleSigned), { NULL, NULL } }; Luna::PropertyType Vector_BindLua::properties[] = { @@ -656,6 +657,27 @@ namespace wi::lua wi::lua::SError(L, "GetAngle(Vector a,b,axis, opt float max) not enough arguments!"); return 0; } + int Vector_BindLua::GetAngleSigned(lua_State* L) + { + int argc = wi::lua::SGetArgCount(L); + if (argc > 2) + { + Vector_BindLua* a = Luna::lightcheck(L, 1); + Vector_BindLua* b = Luna::lightcheck(L, 2); + Vector_BindLua* axis = Luna::lightcheck(L, 3); + if (a && b && axis) + { + wi::lua::SSetFloat(L, wi::math::GetAngleSigned(XMLoadFloat4(&a->data), XMLoadFloat4(&b->data), XMLoadFloat4(&axis->data))); + return 1; + } + else + { + wi::lua::SError(L, "GetAngleSigned(Vector a,b,axis) first 3 arguments are not vectors!"); + } + } + wi::lua::SError(L, "GetAngleSigned(Vector a,b,axis) not enough arguments!"); + return 0; + } void Vector_BindLua::Bind() diff --git a/WickedEngine/wiMath_BindLua.h b/WickedEngine/wiMath_BindLua.h index 85fab39e6..cc3a3e0f8 100644 --- a/WickedEngine/wiMath_BindLua.h +++ b/WickedEngine/wiMath_BindLua.h @@ -66,6 +66,7 @@ namespace wi::lua int PlaneFromPoints(lua_State* L); int GetAngle(lua_State* L); + int GetAngleSigned(lua_State* L); static void Bind(); }; diff --git a/WickedEngine/wiPhysics_Jolt.cpp b/WickedEngine/wiPhysics_Jolt.cpp index 80472ebd9..78624827b 100644 --- a/WickedEngine/wiPhysics_Jolt.cpp +++ b/WickedEngine/wiPhysics_Jolt.cpp @@ -261,6 +261,10 @@ namespace wi::physics wi::scene::HumanoidComponent::HumanoidBone humanoid_bone = wi::scene::HumanoidComponent::HumanoidBone::Count; wi::primitive::Capsule capsule; + // water ripple stuff: + float radius = 0; + float time_since_waterripple = 0; + ~RigidBody() { if (physics_scene == nullptr || bodyID.IsInvalid()) @@ -476,6 +480,10 @@ namespace wi::physics settings.mMotionQuality = cMotionQuality; settings.mUserData = (uint64_t)&physicsobject; + XMFLOAT3 extent = cast(physicsobject.shape->GetWorldSpaceBounds(mat, cast(transform.GetScale())).GetExtent()); + physicsobject.radius = std::sqrt(sqr(std::sqrt(sqr(extent.x) + sqr(extent.y))) + sqr(extent.z)); + physicsobject.time_since_waterripple = wi::random::GetRandom(1.0f); // randomize the water ripples a bit + BodyInterface& body_interface = physics_scene.physics_system.GetBodyInterface(); // locking version because this is called from job system! const EActivation activation = physicscomponent.IsStartDeactivated() ? EActivation::DontActivate : EActivation::Activate; @@ -862,6 +870,10 @@ namespace wi::physics physicsobject.physics_scene = scene.physics_scene; + XMFLOAT3 extent = cast(physicsobject.shape->GetWorldSpaceBounds(mat, Vec3(1, 1, 1)).GetExtent()); + physicsobject.radius = std::sqrt(sqr(std::sqrt(sqr(extent.x) + sqr(extent.y))) + sqr(extent.z)); + physicsobject.time_since_waterripple = wi::random::GetRandom(1.0f); // randomize the water ripples a bit + masses[c] = mass; positions[c] = mat.GetTranslation(); constraint_positions[c] = root; @@ -1262,8 +1274,8 @@ namespace wi::physics { const Vec3 com = body_interface.GetCenterOfMassPosition(physicsobject.bodyID); const Vec3 surface_position = cast(scene.GetOceanPosAt(cast(com))); - - if (com.GetY() <= surface_position.GetY()) + const float diff = com.GetY() - surface_position.GetY(); + if (diff < 0) { const Vec3 p2 = cast(scene.GetOceanPosAt(cast(com + Vec3(0, 0, 0.1f)))); const Vec3 p3 = cast(scene.GetOceanPosAt(cast(com + Vec3(0.1f, 0, 0)))); @@ -1280,6 +1292,16 @@ namespace wi::physics physics_scene.physics_system.GetGravity(), scene.dt ); + + if (diff > -physicsobject.radius) + { + physicsobject.time_since_waterripple += scene.dt; + if (physicsobject.time_since_waterripple > 0.2f) + { + physicsobject.time_since_waterripple = 0; + scene.PutWaterRipple(cast(surface_position)); + } + } } } } @@ -1440,8 +1462,8 @@ namespace wi::physics auto& rb = ragdoll.rigidbodies[bodypart]; const Vec3 com = body_interface.GetCenterOfMassPosition(rb.bodyID); const Vec3 surface_position = cast(scene.GetOceanPosAt(cast(com))); - - if (com.GetY() <= surface_position.GetY()) + const float diff = com.GetY() - surface_position.GetY(); + if (diff < 0) { const Vec3 p2 = cast(scene.GetOceanPosAt(cast(com + Vec3(0, 0, 0.1f)))); const Vec3 p3 = cast(scene.GetOceanPosAt(cast(com + Vec3(0.1f, 0, 0)))); @@ -1458,6 +1480,16 @@ namespace wi::physics physics_scene.physics_system.GetGravity(), scene.dt ); + + if (diff > -rb.radius) + { + rb.time_since_waterripple += scene.dt; + if (rb.time_since_waterripple > 0.2f) + { + rb.time_since_waterripple = 0; + scene.PutWaterRipple(cast(surface_position)); + } + } } } } diff --git a/WickedEngine/wiPrimitive.cpp b/WickedEngine/wiPrimitive.cpp index 923221571..d2f374738 100644 --- a/WickedEngine/wiPrimitive.cpp +++ b/WickedEngine/wiPrimitive.cpp @@ -80,7 +80,7 @@ namespace wi::primitive float AABB::getRadius() const { XMFLOAT3 abc = getHalfWidth(); - return std::sqrt(std::pow(std::sqrt(std::pow(abc.x, 2.0f) + std::pow(abc.y, 2.0f)), 2.0f) + std::pow(abc.z, 2.0f)); + return std::sqrt(sqr(std::sqrt(sqr(abc.x) + sqr(abc.y))) + sqr(abc.z)); } AABB::INTERSECTION_TYPE AABB::intersects(const AABB& b) const { diff --git a/WickedEngine/wiScene.cpp b/WickedEngine/wiScene.cpp index 3c9ff3c85..3dd0a1108 100644 --- a/WickedEngine/wiScene.cpp +++ b/WickedEngine/wiScene.cpp @@ -3279,18 +3279,18 @@ namespace wi::scene ik_pos = right_result.position; } } - character.root_offset = wi::math::Lerp(character.root_offset, diff, 0.1f); + character.foot_offset = wi::math::Lerp(character.foot_offset, diff, 0.1f); } else { - character.root_offset = wi::math::Lerp(character.root_offset, 0.0f, 0.1f); + character.foot_offset = wi::math::Lerp(character.foot_offset, 0.0f, 0.1f); } TransformComponent* humanoid_transform = transforms.GetComponent(character.humanoidEntity); if (humanoid_transform != nullptr) { // Offset root transform to lower foot pos: - humanoid_transform->translation_local.y = character.root_offset; + humanoid_transform->translation_local.y = character.foot_offset; humanoid_transform->SetDirty(); } @@ -5428,7 +5428,6 @@ namespace wi::scene wi::jobsystem::Dispatch(ctx, (uint32_t)characters.GetCount(), 1, [&](wi::jobsystem::JobArgs args) { CharacterComponent& character = characters[args.jobIndex]; Entity entity = characters.GetEntity(args.jobIndex); - XMMATRIX facing_rot = XMMatrixLookToLH(XMVectorZero(), XMLoadFloat3(&character.facing), up); if (character.IsActive()) { uint32_t layer = 0; @@ -5474,7 +5473,10 @@ namespace wi::scene XMVECTOR velocity = XMLoadFloat3(&character.velocity); XMVECTOR inertia = XMLoadFloat3(&character.inertia); - XMVECTOR movement = XMLoadFloat3(&character.movement); + XMVECTOR facing_next = XMVector3Normalize(XMVectorSetY(XMLoadFloat3(&character.facing_next), 0)); + XMVECTOR facing = XMVector3Normalize(XMVectorSetY(XMLoadFloat3(&character.facing), 0)); + const float facing_correctness = XMVectorGetX(XMVectorSaturate(XMVector3Dot(facing, facing_next))); + XMVECTOR movement = XMLoadFloat3(&character.movement) * facing_correctness; XMVECTOR position = XMLoadFloat3(&character.position); XMVECTOR height = XMVectorSet(0, character.height, 0, 0); @@ -5623,17 +5625,26 @@ namespace wi::scene position += XMVectorSet(0, swim_offset, 0, 0); + const float horizontal_velocity_length = XMVectorGetX(XMVector3Length(XMVectorSetY(velocity, 0))); + // Smooth facing: - character.facing = wi::math::Lerp(character.facing, character.facing_next, dt * 5); - character.facing.y = 0; - XMVECTOR facing_next = XMVector3Normalize(XMLoadFloat3(&character.facing_next)); - XMVECTOR facing = XMVector3Normalize(XMLoadFloat3(&character.facing)); + float faceangle = -wi::math::GetAngleSigned(facing_next, facing, up); + const float turning_speed = clamp(character.turning_speed * dt, 0.0f, std::abs(faceangle)); + if (faceangle < 0) + { + facing = XMVector3Rotate(facing, XMQuaternionNormalize(XMQuaternionRotationNormal(up, -turning_speed))); + } + else if (faceangle > 0) + { + facing = XMVector3Rotate(facing, XMQuaternionNormalize(XMQuaternionRotationNormal(up, turning_speed))); + } + facing = XMVectorSetY(facing, 0); + facing = XMVector3Normalize(facing); XMStoreFloat3(&character.facing, facing); // Smooth leaning: - XMVECTOR facediff = XMVector3TransformNormal(facing_next - facing, facing_rot); - float velocity_leaning = clamp(XMVectorGetX(facediff * XMVector3Length(XMVectorSetY(velocity, 0))) * 0.08f, -leaning_limit, leaning_limit); - character.leaning_next = lerp(character.leaning_next, velocity_leaning, dt * 5); + const float turn_leaning = clamp(faceangle / XM_PI * horizontal_velocity_length * facing_correctness, -leaning_limit, leaning_limit); + character.leaning_next = lerp(character.leaning_next, turn_leaning, dt * 5); character.leaning = lerp(character.leaning, character.leaning_next, dt * 5); // Simple animation blending: @@ -5664,7 +5675,6 @@ namespace wi::scene } // Try to put water ripple under character: - float horizontal_velocity_length = XMVectorGetX(XMVector3Length(XMVectorSetY(velocity, 0))); if (horizontal_velocity_length > 0.01) { XMFLOAT3 ocean_pos = GetOceanPosAt(character.position); @@ -5716,6 +5726,7 @@ namespace wi::scene TransformComponent* transform = transforms.GetComponent(entity); if (transform != nullptr) { + XMMATRIX facing_rot = XMMatrixLookToLH(XMVectorZero(), XMLoadFloat3(&character.facing), up); facing_rot = XMMatrixInverse(nullptr, facing_rot); XMVECTOR quat = XMQuaternionRotationMatrix(facing_rot * rotY); diff --git a/WickedEngine/wiScene_BindLua.cpp b/WickedEngine/wiScene_BindLua.cpp index a23c62fed..74c19e308 100644 --- a/WickedEngine/wiScene_BindLua.cpp +++ b/WickedEngine/wiScene_BindLua.cpp @@ -7670,6 +7670,7 @@ Luna::FunctionType CharacterComponent_BindLua::metho lunamethod(CharacterComponent_BindLua, SetWaterFriction), lunamethod(CharacterComponent_BindLua, SetSlopeThreshold), lunamethod(CharacterComponent_BindLua, SetLeaningLimit), + lunamethod(CharacterComponent_BindLua, SetTurningSpeed), lunamethod(CharacterComponent_BindLua, SetFixedUpdateFPS), lunamethod(CharacterComponent_BindLua, SetGravity), lunamethod(CharacterComponent_BindLua, SetWaterVerticalOffset), @@ -7706,6 +7707,7 @@ Luna::FunctionType CharacterComponent_BindLua::metho lunamethod(CharacterComponent_BindLua, GetRelativeOffset), lunamethod(CharacterComponent_BindLua, GetLeaning), lunamethod(CharacterComponent_BindLua, GetLeaningSmoothed), + lunamethod(CharacterComponent_BindLua, GetFootOffset), lunamethod(CharacterComponent_BindLua, SetPathGoal), lunamethod(CharacterComponent_BindLua, GetPathQuery), @@ -7883,6 +7885,17 @@ int CharacterComponent_BindLua::SetLeaningLimit(lua_State* L) component->leaning_limit = wi::lua::SGetFloat(L, 1); return 0; } +int CharacterComponent_BindLua::SetTurningSpeed(lua_State* L) +{ + int argc = wi::lua::SGetArgCount(L); + if (argc < 1) + { + wi::lua::SError(L, "SetTurningSpeed(float value) not enough arguments!"); + return 0; + } + component->turning_speed = wi::lua::SGetFloat(L, 1); + return 0; +} int CharacterComponent_BindLua::SetFixedUpdateFPS(lua_State* L) { int argc = wi::lua::SGetArgCount(L); @@ -8163,6 +8176,11 @@ int CharacterComponent_BindLua::GetLeaningSmoothed(lua_State* L) wi::lua::SSetFloat(L, component->GetLeaningSmoothed()); return 1; } +int CharacterComponent_BindLua::GetFootOffset(lua_State* L) +{ + wi::lua::SSetFloat(L, component->foot_offset); + return 1; +} int CharacterComponent_BindLua::SetPathGoal(lua_State* L) { diff --git a/WickedEngine/wiScene_BindLua.h b/WickedEngine/wiScene_BindLua.h index b42042364..9e5ac9c3f 100644 --- a/WickedEngine/wiScene_BindLua.h +++ b/WickedEngine/wiScene_BindLua.h @@ -1893,6 +1893,7 @@ namespace wi::lua::scene int SetWaterFriction(lua_State* L); int SetSlopeThreshold(lua_State* L); int SetLeaningLimit(lua_State* L); + int SetTurningSpeed(lua_State* L); int SetFixedUpdateFPS(lua_State* L); int SetGravity(lua_State* L); int SetWaterVerticalOffset(lua_State* L); @@ -1929,6 +1930,7 @@ namespace wi::lua::scene int IsCharacterToCharacterCollisionDisabled(lua_State* L); int GetLeaning(lua_State* L); int GetLeaningSmoothed(lua_State* L); + int GetFootOffset(lua_State* L); int SetPathGoal(lua_State* L); int GetPathQuery(lua_State* L); diff --git a/WickedEngine/wiScene_Components.cpp b/WickedEngine/wiScene_Components.cpp index 3b57951d7..017d26c64 100644 --- a/WickedEngine/wiScene_Components.cpp +++ b/WickedEngine/wiScene_Components.cpp @@ -2676,13 +2676,6 @@ namespace wi::scene } void CharacterComponent::Turn(const XMFLOAT3& direction) { - XMVECTOR F = XMLoadFloat3(&facing); - float dot = XMVectorGetX(XMVector3Dot(F, XMLoadFloat3(&direction))); - if (dot < 0) - { - // help with turning around 180 degrees: - XMStoreFloat3(&facing, XMVector3TransformNormal(F, XMMatrixRotationY(XM_PI * 0.05f))); - } facing_next = direction; } void CharacterComponent::Lean(float amount) diff --git a/WickedEngine/wiScene_Components.h b/WickedEngine/wiScene_Components.h index 25d5fcdad..df3f04c5e 100644 --- a/WickedEngine/wiScene_Components.h +++ b/WickedEngine/wiScene_Components.h @@ -2193,6 +2193,7 @@ namespace wi::scene float fixed_update_fps = 120; float gravity = -30; float water_vertical_offset = 0; + float turning_speed = 10; XMFLOAT3 movement = XMFLOAT3(0, 0, 0); XMFLOAT3 velocity = XMFLOAT3(0, 0, 0); XMFLOAT3 inertia = XMFLOAT3(0, 0, 0); @@ -2213,7 +2214,7 @@ namespace wi::scene wi::ecs::Entity humanoidEntity = wi::ecs::INVALID_ENTITY; wi::ecs::Entity left_foot = wi::ecs::INVALID_ENTITY; wi::ecs::Entity right_foot = wi::ecs::INVALID_ENTITY; - float root_offset = 0; + float foot_offset = 0; bool foot_placement_enabled = true; wi::PathQuery pathquery; // completed wi::vector animations; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 6fd0a9c2f..f7aff0950 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wi::version // minor features, major updates, breaking compatibility changes const int minor = 71; // minor bug fixes, alterations, refactors, updates - const int revision = 677; + const int revision = 678; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);