[Code submission] Some MODELDEF features/fixes.

Moderator: Graf Zahl

Locked
Geometer
Posts: 38
Joined: Wed Jul 16, 2008 18:42
Location: Russia, Saint-Petersburg

[Code submission] Some MODELDEF features/fixes.

Post 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.
Attachments
Models.7z
Patch, that adds listed above features
(12.21 KiB) Downloaded 223 times
Geometer
Posts: 38
Joined: Wed Jul 16, 2008 18:42
Location: Russia, Saint-Petersburg

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

Post 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?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

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

Post by Graf Zahl »

No time to test, actually...
Geometer
Posts: 38
Joined: Wed Jul 16, 2008 18:42
Location: Russia, Saint-Petersburg

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

Post by Geometer »

OK. If you want, I can provide some testing materials.
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

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

Post 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.
Geometer
Posts: 38
Joined: Wed Jul 16, 2008 18:42
Location: Russia, Saint-Petersburg

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

Post 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.
Attachments
ModelTest.pk3
Test map, which shows different model transformations and relations between them.
(7.33 KiB) Downloaded 218 times
models_r2.7z
New patch.
(12.1 KiB) Downloaded 230 times
Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

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

Post by Edward-san »

Yeah, now this is ok. Let's wait for Graf's response.
dark-slayer-201
Posts: 149
Joined: Thu Jul 16, 2009 14:31

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

Post by dark-slayer-201 »

This is something i would like to see.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

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

Post 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!
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

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

Post by Gez »

Okay this has waited long enough.
Locked

Return to “Closed Feature Suggestions”