Skip to main content

Posts

Showing posts from February, 2007

Directional player-controlled character movement

I finally was able to replicate in CalvaryGDK directional player-controlled character movement that you find in 3rd person games and platform games. The trick is to set the linear velocity to zero on all axis. Recommended for human movement behavior. The changes are in the SVN trunk at sourceforge. I will try to make a classic spaceship game with Calvary and released soon (maybe this weekend?). //move the object using forces but stop forcing after a speed is reached // only ONE of the components should be filled. RubyMethod move_forced(VALUE self, VALUE x, VALUE y, VALUE z, VALUE max_speed) { guard(GameObject.move_forced); CWorldObject *obj = internal(self); //std::cout move_forced " GetLinearVelocity().X; if (abs(obj->GetLinearVelocity().X) ApplyForce(RubyFloat::internal(x), 0.0f, 0.0f); } else { float cy = RubyFloat::internal(y); if (cy != 0.0f) { //std::cout GetLinearVelocity().Y; if (abs(obj->GetLinearVelocity()...

No bones

Don't use custom moving bones for animations. Just Take a apart every part of the mesh and export it on its own. Because they all have a 0,0,0 origin, the end result should be the same character being displayed.

Back to rails! (only for a while tho)

Got so excited with focus sis and rails at work that I decided to work on a new personal project. The new project will help new and advance users to use a simple GUI to create web applications based in rails. The project's aim is to have the same easiness to use that MS Access has. However, thanks to the power of ruby on rails, the end result could be a MS Access killer :). Tonight, I worked on the code to generate forms from a GUI wizard.

Angular factor now works

Setting the angular factor on my 3d object was not working. Then I realize that I had left out the RubyFloat::internal method call to convert the VALUE passed into a c++ float. Without the conversion, the RubyGameObject was passing a value of 1 to the set_angular_factor method. Now the 3d object's position is affected by physics but not its rotation, which is good for character control. RubyMethod set_angular_factor(VALUE self, VALUE angular_factor) { guard(GameObject.set_angular_factor); CWorldObject *obj = internal(self); obj->set_angular_factor(RubyFloat::internal(angular_factor)); //line that had the problem return Qnil; unguard }