[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 » Tue Jul 12, 2011 23:36

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 114 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 » Wed Jul 20, 2011 18:43

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 » Wed Jul 20, 2011 21:48

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 » Thu Jul 21, 2011 10:45

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 » Thu Jul 21, 2011 19:55

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 » Fri Jul 22, 2011 0:01

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 117 times
models_r2.7z
New patch.
(12.1 KiB) Downloaded 123 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 » Fri Jul 22, 2011 12:37

Yeah, now this is ok. Let's wait for Graf's response.

dark-slayer-201
Steam - ds201
Posts: 149
Joined: Thu Jul 16, 2009 14:31
Location: South Australia. Adelaide's outdoor mall has 2 big balls of steel!

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

Post by dark-slayer-201 » Wed Jul 27, 2011 14:26

This is something i would like to see.
Image
Hello Username

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 » Wed Oct 19, 2011 8:43

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: 1392
Joined: Mon Oct 22, 2007 16:47

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

Post by Gez » Sat Nov 26, 2011 19:51

Okay this has waited long enough.

Locked

Return to “Closed Feature Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest