[Scummvm-cvs-logs] CVS: residual actor.cpp,1.11,1.12 actor.h,1.6,1.7 costume.cpp,1.7,1.8 costume.h,1.4,1.5 lua.cpp,1.29,1.30
Vincent Hamm
yazoo at users.sourceforge.net
Tue Aug 26 02:52:24 CEST 2003
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1:/tmp/cvs-serv15440
Modified Files:
actor.cpp actor.h costume.cpp costume.h lua.cpp
Log Message:
A bit more code for the lookAt system
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- actor.cpp 26 Aug 2003 00:25:22 -0000 1.11
+++ actor.cpp 26 Aug 2003 09:36:47 -0000 1.12
@@ -163,6 +163,12 @@
}
}
+void Actor::setHead( int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw ) {
+ if (!costumeStack_.empty()) {
+ costumeStack_.back()->setHead( joint1, joint2, joint3, maxRoll, maxPitch, maxYaw);
+ }
+}
+
Costume *Actor::findCostume(const char *name) {
for (std::list<Costume *>::iterator i = costumeStack_.begin();
i != costumeStack_.end(); i++)
Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- actor.h 26 Aug 2003 00:25:22 -0000 1.6
+++ actor.h 26 Aug 2003 09:36:47 -0000 1.7
@@ -102,6 +102,10 @@
void setLookAtRate( float rate ) {
lookAtRate_ = rate;
}
+ float lookAtRate() {
+ return(lookAtRate_);
+ }
+ void setHead( int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw );
private:
std::string name_;
Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- costume.cpp 24 Aug 2003 17:56:03 -0000 1.7
+++ costume.cpp 26 Aug 2003 09:36:47 -0000 1.8
@@ -747,3 +747,12 @@
components_[i]->update();
}
+void Costume::setHead( int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw )
+{
+ head_.joint1 = joint1;
+ head_.joint2 = joint2;
+ head_.joint3 = joint3;
+ head_.maxRoll = maxRoll;
+ head_.maxPitch = maxPitch;
+ head_.maxYaw = maxYaw;
+}
\ No newline at end of file
Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- costume.h 20 Aug 2003 14:29:59 -0000 1.4
+++ costume.h 26 Aug 2003 09:36:47 -0000 1.5
@@ -45,6 +45,8 @@
void stopTalkChores();
void setTalkChore(int index, int chore);
+ void setHead( int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw );
+
void update();
void draw();
@@ -84,6 +86,15 @@
int numKeys_;
TrackKey *keys_;
};
+
+ struct Head {
+ int joint1;
+ int joint2;
+ int joint3;
+ float maxRoll;
+ float maxPitch;
+ float maxYaw;
+ } head_;
class Chore {
public:
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- lua.cpp 26 Aug 2003 00:28:02 -0000 1.29
+++ lua.cpp 26 Aug 2003 09:36:47 -0000 1.30
@@ -542,6 +542,31 @@
act->setLooking( true );
}
+static void SetActorLookRate() {
+ Actor *act = check_actor(1);
+ float rate = luaL_check_number(2);
+
+ act->setLookAtRate( rate );
+}
+
+static void GetActorLookRate() {
+ Actor *act = check_actor(1);
+
+ lua_pushnumber( act->lookAtRate() );
+}
+
+static void SetActorHead() {
+ Actor *act = check_actor(1);
+ int joint1 = check_int(2);
+ int joint2 = check_int(3);
+ int joint3 = check_int(4);
+ float maxRoll = luaL_check_number(5); // Yaz: recheck to see if it's really roll
+ float maxPitch = luaL_check_number(6);
+ float maxYaw = luaL_check_number(7);
+
+ act->setHead( joint1, joint2, joint3, maxRoll, maxPitch, maxYaw );
+}
+
static void GetVisibleThings() {
lua_Object result = lua_createtable();
Actor *sel = Engine::instance()->selectedActor();
@@ -1084,10 +1109,7 @@
"IsPointInSector",
"SetActorFrustrumCull",
"SetActorFollowBoxes",
- "SetActorHead",
"GetCameraActor",
- "GetActorLookRate",
- "SetActorLookRate",
"DriveActorTo",
"WalkActorVector",
"PutActorAtInterest",
@@ -1356,6 +1378,9 @@
{ "ShutUpActor", ShutUpActor },
{ "HardwareAccelerated", HardwareAccelerated },
{ "ActorLookAt", ActorLookAt },
+ { "SetActorLookRate", SetActorLookRate },
+ { "GetActorLookRate", GetActorLookRate },
+ { "SetActorHead", SetActorHead },
};
void register_lua() {
More information about the Scummvm-git-logs
mailing list