Page 1 of 1

[Code submission] Some MODELDEF features/fixes.

Posted: Tue Jul 12, 2011 23:36
by Geometer
I've created patch that adds some features. Many of them were requested before.

Fixed:
  • odd PITCHFROMMOMENTUM flag behavior: when actor was moving backwards, its pitch calculated incorrectly;
  • another PITCHFROMMOMENTUM issue: when actor's velocity was 0, actor model disappeared.
Added new properties:
  • Offset property:

    Code: Select all

    offset <xoffset> <yoffset> <zoffset>
    Sets actor x/y/z offsets.
  • AngleOffset property:

    Code: Select all

    angleoffset <angle>
    Changes model yaw angle. <angle> --- floating point value in degrees.
  • PitchOffset property:

    Code: Select all

    pitchoffset <pitch>
    Changes model pitch angle. <pitch> --- floating point value in degrees.
  • RollOffset property:

    Code: Select all

    rolloffset <roll>
    Changes model roll angle. <roll> --- floating point value in degrees.

Added new flags:
  • INHERITACTORPITCH --- model's pitch adjusts to match actor's pitch. So you can control model pitch via ACS/Decorate scripts.
  • INHERITACTORROLL --- the same for roll, but due to the absence proper ACS/Decorate functions (e. g. SetActorRoll), this is useless for now. This is groundwork for future.
Notes:
  • If both flags INHERITACTORPITCH and PITCHFROMMOMENTUM are set, model pitch summarize actror's pitch and momentum vector's pitch (and of course pitchoffset).
  • The sequence of transformations applied to the model is:
    1) Rotating model using angleoffset, pitchoffset, rolloffset parameters;
    2) Scaling model;
    3) Applying offset to the model.
  • If the ROTATING flag is set, model rotation takes place AFTER listed transrormations;
  • All actor properties like actor angle and actor pitch (if the INHERITACTORPITCH flag is set) applies at the end of all thansformations.
  • If the PITCHFROMMOMENTUM flag is set, momentum vector's pitch applies at the same moment when actor pitch is applied.
All of this features were tested and were working. However I'm not sure if patch file was created properly, so I also attached gl_models.cpp and gl_models.h files.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Wed Jul 20, 2011 18:43
by Geometer
So, is it going to happen? A week passed, but I can't see any response. May be some critical problems in the suggested code?

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Wed Jul 20, 2011 21:48
by Graf Zahl
No time to test, actually...

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Thu Jul 21, 2011 10:45
by Geometer
OK. If you want, I can provide some testing materials.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Thu Jul 21, 2011 19:55
by Edward-san
May I suggest you, Geometer, to post the output of "svn diff" instead of "diff -rup" ? Usually Graf uses Tortoise SVN to patch the datas, and it doesn't accept the non-svn patches.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Fri Jul 22, 2011 0:01
by Geometer
I've found a bug in the suggested code. Actually it was incorrectly fixed first issue:
Geometer wrote:odd PITCHFROMMOMENTUM flag behavior: when actor was moving backwards, its pitch calculated incorrectly;
However, in the new patch I have fixed it correctly. I hope, that new patch was made properly this time, I tried to follow your suggestion, Edward-san. Also I've attached small test map, which shows the main features of this patch. May be it will be useful.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Fri Jul 22, 2011 12:37
by Edward-san
Yeah, now this is ok. Let's wait for Graf's response.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Wed Jul 27, 2011 14:26
by dark-slayer-201
This is something i would like to see.

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Wed Oct 19, 2011 8:43
by Nash
Oh I've been wanting roll for ages! I need it for my drivable vehicles to properly orient on sloped terrain.

So now all that's needed is a way to set the roll via ACS or DECORATE correct?

Good stuff Geometer, I hope these make it in!

Re: [Code submission] Some MODELDEF features/fixes.

Posted: Sat Nov 26, 2011 19:51
by Gez
Okay this has waited long enough.