mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixes for animations with head and jump, etc.
This commit is contained in:
parent
142964938c
commit
283a1ef48b
16 changed files with 147 additions and 109 deletions
|
|
@ -5,10 +5,12 @@ define([
|
|||
"Game/Server/Control/PlayerController",
|
||||
"Lib/Utilities/RequestAnimFrame",
|
||||
"Game/Core/NotificationCenter",
|
||||
"Game/Server/Player"
|
||||
"Game/Server/Player",
|
||||
"Game/Server/GameObjects/GameObject",
|
||||
"Game/Server/Physics/Doll"
|
||||
],
|
||||
|
||||
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, NotificationCenter, Player) {
|
||||
function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, NotificationCenter, Player, GameObject, Doll) {
|
||||
|
||||
function GameController (channel) {
|
||||
Parent.call(this, new PhysicsEngine());
|
||||
|
|
@ -74,17 +76,28 @@ function (Parent, PhysicsEngine, Settings, PlayerController, requestAnimFrame, N
|
|||
|
||||
var body = this.physicsEngine.world.GetBodyList();
|
||||
do {
|
||||
var userData = body.GetUserData();
|
||||
if(body.IsAwake()) {
|
||||
var userData = body.GetUserData();
|
||||
|
||||
if(userData && body.IsAwake()) {
|
||||
update[userData] = {
|
||||
p: body.GetPosition(),
|
||||
a: body.GetAngle(),
|
||||
lv: body.GetLinearVelocity(),
|
||||
av: body.GetAngularVelocity()
|
||||
};
|
||||
isUpdateNeeded = true;
|
||||
if (userData instanceof GameObject) {
|
||||
var gameObject = userData;
|
||||
|
||||
update[gameObject.uid] = {
|
||||
p: body.GetPosition(),
|
||||
a: body.GetAngle(),
|
||||
lv: body.GetLinearVelocity(),
|
||||
av: body.GetAngularVelocity()
|
||||
};
|
||||
|
||||
if(gameObject instanceof Doll) {
|
||||
update[gameObject.uid].as = gameObject.getActionState();
|
||||
update[gameObject.uid].laxy = gameObject.lookAtXY;
|
||||
}
|
||||
|
||||
isUpdateNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
} while (body = body.GetNext());
|
||||
|
||||
if(isUpdateNeeded) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue