Entity pitch?

ZenonSeth
Member
 
Posts: 14
Joined: Mon Sep 18, 2017 19:23

Entity pitch?

by ZenonSeth » Sun Apr 08, 2018 14:22

Hi guys, I was experimenting with entities in the past and was left with the impression that we can't set an enetity's pitch angle.

However, just recently when doing some other mods i suddenly realized that the mine-carts actually change angle when ascending/descending slopes. I made sure - and sure enough there's only 1 minecart object - so it must be rotated.

I did look through the mine cart code quickly but couldn't find any obvious references to pitch - so figured I'd post and ask here.
 

User avatar
Krock
Developer
 
Posts: 4055
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Entity pitch?

by Krock » Sun Apr 08, 2018 15:41

You're totally correct that there's only one minecart object but its "pitch" change is done by three different animations, which are then used depending on whether the cart drives straight forward, upwards or downwards: code reference

Attached objects can also be rotated, which looks the same as a "pitch" rotate, as used here in boost_cart to tilt the player model slightly, depending on the direction.

A non-ugly pitch/roll function was already requested multiple times, but yet it wasn't added - either nobody cares, knows how it works or it's yet not possible in a nice way using the Irrlicht engine - I don't know.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

ZenonSeth
Member
 
Posts: 14
Joined: Mon Sep 18, 2017 19:23

Re: Entity pitch?

by ZenonSeth » Sun Apr 08, 2018 16:40

That makes sense, at least there's kind of a work around.

I haven't found a case where I absolutely needed to make pitch but I was changing how some frames worked to allow rotation and various attachment of the displayed object in it - and wanted to make a tiled/upside-down entity. Doesn't quite seem like I could do that with this, but thanks for the info, good to know
 

User avatar
stu
Member
 
Posts: 893
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Entity pitch?

by stu » Tue Apr 10, 2018 16:48

Krock wrote:A non-ugly pitch/roll function was already requested multiple times, but yet it wasn't added - either nobody cares, knows how it works or it's yet not possible in a nice way using the Irrlicht engine - I don't know.


There is certainly nothing in Irrlicht that prohibits pitch control, afaik native scene nodes only expose methods for position scale and (Euler) rotation, ie there is no notion of pitch, yaw or roll. Of course you can also manipulate the transform matrix directly and work with quaternions or whatever takes your fancy :)

I am really not sure why this has not yet been implement in the MT engine, maybe there was a good reason not to allow that but I think more likely the author did not think it necessary for a voxel game or it was simply an oversight.

One thing to consider is that if MT ever did support non axis-aligned collisions, the inclusion of pitch/roll would make that even more computationally expensive, however, I am not really sure if it would make that big a difference.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests