Player names
This commit is contained in:
@@ -23,9 +23,7 @@
|
|||||||
<Blue/>
|
<Blue/>
|
||||||
</Team>
|
</Team>
|
||||||
</c:Team>
|
</c:Team>
|
||||||
<c:Transform>
|
<c:Transform/>
|
||||||
<Position X="0" Y="0.0288832653" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
</Components>
|
||||||
|
|
||||||
<Children>
|
<Children>
|
||||||
@@ -37,20 +35,6 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="PlayerName">
|
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,100</Resource>
|
|
||||||
<Color A="1" B="0" G="1" R="0"/>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.100000001" Y="0.248000011" Z="-0.248000011"/>
|
|
||||||
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
|
|
||||||
<Orientation X="0" Y="3.14199996" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="CameraModel">
|
<Entity name="CameraModel">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
@@ -504,7 +488,6 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
|
<Resource>Models/Characters/Assault/AssaultAnimations.mesh</Resource>
|
||||||
<Color A="1" B="1" G="0.309803933" R="0"/>
|
<Color A="1" B="1" G="0.309803933" R="0"/>
|
||||||
<Visible>false</Visible>
|
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -574,6 +557,21 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="PlayerName">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Insert name here</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,100</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.100000001" Y="1.50176644" Z="-0.248000011"/>
|
||||||
|
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
|
||||||
|
<Orientation X="0" Y="3.14199996" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -35,20 +35,6 @@
|
|||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
<Entity name="PlayerName">
|
|
||||||
<Components>
|
|
||||||
<c:Text>
|
|
||||||
<Resource>Fonts/DroidSans.ttf,100</Resource>
|
|
||||||
<Color A="1" B="0" G="1" R="0"/>
|
|
||||||
</c:Text>
|
|
||||||
<c:Transform>
|
|
||||||
<Position X="0.100000001" Y="0.248000011" Z="-0.248000011"/>
|
|
||||||
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
|
|
||||||
<Orientation X="0" Y="3.14199996" Z="0"/>
|
|
||||||
</c:Transform>
|
|
||||||
</Components>
|
|
||||||
<Children/>
|
|
||||||
</Entity>
|
|
||||||
<Entity name="CameraModel">
|
<Entity name="CameraModel">
|
||||||
<Components>
|
<Components>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
@@ -571,6 +557,21 @@
|
|||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
</Entity>
|
</Entity>
|
||||||
|
<Entity name="PlayerName">
|
||||||
|
<Components>
|
||||||
|
<c:Text>
|
||||||
|
<Content>Insert name here</Content>
|
||||||
|
<Resource>Fonts/DroidSans.ttf,100</Resource>
|
||||||
|
<Color A="1" B="0" G="1" R="0"/>
|
||||||
|
</c:Text>
|
||||||
|
<c:Transform>
|
||||||
|
<Position X="0.100000001" Y="1.50199997" Z="-0.248000011"/>
|
||||||
|
<Scale X="0.100000001" Y="0.113000005" Z="0.5"/>
|
||||||
|
<Orientation X="0" Y="3.14199996" Z="0"/>
|
||||||
|
</c:Transform>
|
||||||
|
</Components>
|
||||||
|
<Children/>
|
||||||
|
</Entity>
|
||||||
</Children>
|
</Children>
|
||||||
|
|
||||||
</Entity>
|
</Entity>
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ void Skeleton::AccumulateBoneTransforms(bool noRootMotion, std::vector<Animation
|
|||||||
|
|
||||||
|
|
||||||
if (progress > 1.0f || progress < 0.0f) {
|
if (progress > 1.0f || progress < 0.0f) {
|
||||||
LOG_INFO("Progress: %f", progress);
|
|
||||||
progress = glm::clamp(progress, 0.0f, 1.0f);
|
progress = glm::clamp(progress, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
||||||
@@ -241,7 +240,6 @@ void Skeleton::AccumulateBoneTransforms(bool noRootMotion, std::vector<Animation
|
|||||||
|
|
||||||
|
|
||||||
if (progress > 1.0f || progress < 0.0f) {
|
if (progress > 1.0f || progress < 0.0f) {
|
||||||
LOG_INFO("Progress: %f", progress);
|
|
||||||
progress = glm::clamp(progress, 0.0f, 1.0f);
|
progress = glm::clamp(progress, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
||||||
@@ -489,7 +487,6 @@ glm::mat4 Skeleton::GetBoneTransform(bool noRootMotion, const Bone* bone, std::v
|
|||||||
|
|
||||||
|
|
||||||
if (progress > 1.0f || progress < 0.0f) {
|
if (progress > 1.0f || progress < 0.0f) {
|
||||||
LOG_INFO("Progress: %f", progress);
|
|
||||||
progress = glm::clamp(progress, 0.0f, 1.0f);
|
progress = glm::clamp(progress, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
||||||
@@ -609,12 +606,10 @@ glm::mat4 Skeleton::GetBoneTransform(bool noRootMotion, const Bone* bone, std::v
|
|||||||
progress = (time - currentFrame.Time) / (animation->Duration - currentFrame.Time);
|
progress = (time - currentFrame.Time) / (animation->Duration - currentFrame.Time);
|
||||||
} else {
|
} else {
|
||||||
progress = (time - currentFrame.Time) / (nextFrame.Time - currentFrame.Time);
|
progress = (time - currentFrame.Time) / (nextFrame.Time - currentFrame.Time);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (progress > 1.0f || progress < 0.0f) {
|
if (progress > 1.0f || progress < 0.0f) {
|
||||||
LOG_INFO("Progress: %f", progress);
|
|
||||||
progress = glm::clamp(progress, 0.0f, 1.0f);
|
progress = glm::clamp(progress, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
Animation::Keyframe::BoneProperty currentBoneProperty = currentFrame.BoneProperties;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ bool MultiplayerSnapshotFilter::FilterComponent(EntityWrapper entity, SharedComp
|
|||||||
|| component.Info.Name == "AssaultWeapon"
|
|| component.Info.Name == "AssaultWeapon"
|
||||||
|| component.Info.Name == "Animation"
|
|| component.Info.Name == "Animation"
|
||||||
|| component.Info.Name == "AnimationOffset"
|
|| component.Info.Name == "AnimationOffset"
|
||||||
|
|| entity.Name() == "PlayerName"
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,18 +79,18 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
}
|
}
|
||||||
glm::vec3& velocity = cPhysics["Velocity"];
|
glm::vec3& velocity = cPhysics["Velocity"];
|
||||||
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
bool isOnGround = (bool)cPhysics["IsOnGround"];
|
||||||
ImGui::Text(isOnGround ? "On ground" : "In air");
|
//ImGui::Text(isOnGround ? "On ground" : "In air");
|
||||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
//ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
||||||
glm::vec3 groundVelocity(0.f, 0.f, 0.f);
|
glm::vec3 groundVelocity(0.f, 0.f, 0.f);
|
||||||
groundVelocity.x = velocity.x;
|
groundVelocity.x = velocity.x;
|
||||||
groundVelocity.z = velocity.z;
|
groundVelocity.z = velocity.z;
|
||||||
ImGui::Text("groundVelocity: (%f, %f, %f) |%f|", groundVelocity.x, groundVelocity.y, groundVelocity.z, glm::length(groundVelocity));
|
//ImGui::Text("groundVelocity: (%f, %f, %f) |%f|", groundVelocity.x, groundVelocity.y, groundVelocity.z, glm::length(groundVelocity));
|
||||||
ImGui::Text("wishDirection: (%f, %f, %f) |%f|", wishDirection.x, wishDirection.y, wishDirection.z, glm::length(wishDirection));
|
//ImGui::Text("wishDirection: (%f, %f, %f) |%f|", wishDirection.x, wishDirection.y, wishDirection.z, glm::length(wishDirection));
|
||||||
float currentSpeedProj = glm::dot(groundVelocity, wishDirection);
|
float currentSpeedProj = glm::dot(groundVelocity, wishDirection);
|
||||||
float addSpeed = wishSpeed - currentSpeedProj;
|
float addSpeed = wishSpeed - currentSpeedProj;
|
||||||
ImGui::Text("currentSpeedProj: %f", currentSpeedProj);
|
//ImGui::Text("currentSpeedProj: %f", currentSpeedProj);
|
||||||
ImGui::Text("wishSpeed: %f", wishSpeed);
|
//ImGui::Text("wishSpeed: %f", wishSpeed);
|
||||||
ImGui::Text("addSpeed: %f", addSpeed);
|
//ImGui::Text("addSpeed: %f", addSpeed);
|
||||||
|
|
||||||
if (addSpeed > 0) {
|
if (addSpeed > 0) {
|
||||||
static float accel = 15.f;
|
static float accel = 15.f;
|
||||||
|
|||||||
@@ -128,6 +128,12 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
|
|||||||
// When a player is actually spawned (since the actual spawning is handled on the server)
|
// When a player is actually spawned (since the actual spawning is handled on the server)
|
||||||
// Hack should be moved.
|
// Hack should be moved.
|
||||||
|
|
||||||
|
// TODO: Set the player name to whatever
|
||||||
|
EntityWrapper playerName = e.Player.FirstChildByName("PlayerName");
|
||||||
|
if (playerName.Valid()) {
|
||||||
|
playerName["Text"]["Content"] = e.PlayerName;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsClient) {
|
if (!IsClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -153,12 +159,6 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Set the player name to whatever
|
|
||||||
EntityWrapper playerName = e.Player.FirstChildByName("PlayerName");
|
|
||||||
if (playerName.Valid()) {
|
|
||||||
playerName["Text"]["Content"] = e.PlayerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,10 +181,10 @@ bool PlayerSpawnSystem::OnPlayerDeath(Events::PlayerDeath& e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnRequest req;
|
SpawnRequest req;
|
||||||
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
req.PlayerID = m_PlayerIDs.at(e.Player.ID);
|
||||||
req.Team = cTeam["Team"];
|
req.Team = cTeam["Team"];
|
||||||
m_SpawnRequests.push_back(req);
|
m_SpawnRequests.push_back(req);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user