-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements "noncar" physics #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super!
#define BrVector3Mul(v1, v2, v3) \ | ||
do { \ | ||
(v1)->v[0] = (v2)->v[0] * (v3)->v[0]; \ | ||
(v1)->v[1] = (v2)->v[1] * (v3)->v[1]; \ | ||
(v1)->v[2] = (v2)->v[2] * (v3)->v[2]; \ | ||
} while (0) | ||
|
||
#define BrVector3Div(v1, v2, v3) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions/macro's are not documented in the brender documentation, from foone.
I would move these to a dethrace header and loose the Br
prefix.
This would also keep dethrace working, with (the soon-to-be-open-sourced 🤞) real BRender.
I was not 100% confident though about the naming: vector's already have dot + cross multiplication, and a divide simply does not exist.
But some googling shows me that other engines have added is nonetheless, it's a convenience to have.
unity3 has:
I googled a bit and found this for unity: https://docs.unity3d.com/ScriptReference/Vector3.Scale.html
C# has:
https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector3.multiply?view=net-6.0
https://docs.microsoft.com/en-us/dotnet/api/system.numerics.vector3.divide?view=net-6.0
UnrealScript allowed vect(1,2,3) * vect(2,3,4) = vect(2,6,12)
:
https://wiki.beyondunreal.com/Legacy:UnrealScript_Vector_Maths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, good call. I was being lazy :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I"m fine with adding these.
I want to be lazy too :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, thank you for pointing it out! I'm making the change as you suggest!
#define DOUBLESIDED_FLAG_COLOR_MAP (br_pixelmap*)12345 | ||
#define DOUBLESIDED_USER_FLAG (void*)12345 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we need to do something as following?
typedef struct {
int flags;
} dethrace_material_props;
#define DR_MATUFLAGS_DOUBLE_SIDED 0x01
A nuisance with this approach is the need for allocation, but should be do-able when using BrResAllocate
(which will automatically de-allocate when the parent is de-allocated).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your idea is better in all ways :)
However, since (void*)12345
is what the OG code does, I'd leave refactoring to be cleaner to a different repo/branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, then it's totally fine. I thought this was custom code to fix the lanterns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah cool. Yeah, I'm holding firm to any code in src/DETHRACE
that doesn't come from OG has to be wrapped in the FIX_BUGS macro
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
NonCars
are what the game calls pieces of the track that you can interact with. For example, streetlights can be bent and snapped off, benches can be pushed around etc.RemoveDoubleSided
br_material
andbr_model
structs to align better with real usagegl_renderer
to fix issues with streetlights not rendering from all angles. This matches what we know of the 3dfx version, for example.noncarphysics.short.mp4