There are two common patterns for this: 1) public SomeStruct? GetSomeStruct() using the nullable struct type. The caller checks whether the returned value is non-null (or its .HasValue member), before accessing the struct in the .Value member. 2) public bool TryGetSomeStruct(out SomeStruct value). Then the caller says if (TryGetSomeStruct(out SomeStruct value) ) { /* use value */ }. But this is general C# programming, not specific to game development, so it's something you should ask on StackOverflow. — DMGregory ♦6 mins ago
Dang, I'm stuck in Unity right now. I want to make my game's follow-camera switch to the follow-camera that views from the front, when driving, so that when going reverse, the camera switches so that you can see where you're going.
Problem is, I can't figure out how to detect when I'm actually going backwards.
Because it switches whenever I press the S or DownArrow Key.
As long as you're continuing to drive forward, it should not go negative. You can flatten the forward vector into the ground plane to avoid glitches due to the downward camera angle.
But that'd detect when it goes off screen. If I am going 300 mph and hit the hand brake, that's also going to happen because I'm slowing down faster than the Camera is following it.
Backwards = reverse-cam(+1 different camera option), forwards = normal-cam (+8 different camera options)
And I'm to use a dot product of my car's velocity versus my camera's forward vector?
Oh, yes I see now. You said "screen" only because "screen" comes from camera, and we're using the camera's forward vector versus a dot product of the car's velocity.
I know that if you take the dot-product of two normalized vectors, you get the cosine of the angle between them.
But if I take the dot-product of two non-normalized vectors (or one normalized, one not), how can I interpret the resulting scalar?
Okay. So, I think I have a good understanding of dot, but how would I do this "Compare dot product of car velocity versus camera's forward vector"? Probably my most-occurring compiler error is "Cannot implicitly convert type "something" and "something"" where "something" is like a bool or Vector3 or something, because I get lost with my other variables sometimes.
Like, I've seen operands in scripts that look like these: "&&||", "|?|" and "%&"
It's a name for a cut-off value that you choose. You might set it to -0.1 for example, to be slightly less than zero, so you don't flicker back and forth when the velocity is barely backwards.
@Vaillancourt i don't want you to help me make it i want you to show me a way or maybe a tutorial you once saw that might help me make what i want, and i want to use this for an opengl game — MaxCE2 hours ago
It seems to me that DMGregory already gave them the how-to?
A "model format", like any file format, is just a convention for how you've decided to write down the data you care about as text or bytes. So, your first step is to identify what data you care about. Step two is to decide how you want to express that data as text or bytes. Step three is to write a parser, that reads text/bytes in the arrangement you chose, and converts it to your game's in-memory representation of the model. Which one step of this process do you need help with? — DMGregory ♦6 hours ago
I've interpreted that in too many ways: "That My threshold goes further", "That my threshold should be made to go further", "That you now know that my threshold has the ability to go further", "That the way I used it, it appears that my threshold could go further" and a few more.
My assumption is that I should put my threshold as -0.1 or less
I wanted to make my camera switch to a reverse camera when my car goes in reverse.
Previously, it woould switch when I hit the S key, which caused it to change not only when going backwards, but also when I slow down, and it changes back to normal the instant I let go of the key.
So, I wanted to switch when the car goes backwards.
But instead, it switches the instant I press the S key, like before, but when going reverse, It waits to switch back to normal until I'm actually going forwards. Which is what I wanted for the Forward camera, not the Reverse camera.
But, I'll take it.
As long as I can get it to work for the forward camera, too.
Because Patchacked without a double h would be "Patch-ack'd" but in the old English pronunciation of "Threshold", which was "Thresh-Hold" because it originated from "Thrush-Hold" which was originally a hold for a Thrush, which is a type of bird. So, a double-h would be "Patch-Hacked". See, when splitting it, the double H is turned into an "H" at both the end of the first product of the split, and at the beginning of the second product of the split.
If it weren't a double-H, then the split would leave you with an H at the end of the first product, and no H at the beginning of the second product.
Debugging some mystical render target issues, I push a clear op for the target first, and then some render commands, and somehow the clear and rendering go to different target handles
@Almo and there is another game. I can not find its name. but basically it is very similar to the Deep Rock Galactic. in that game there r also a few classes, but instead of the space the action takes place in forest and u play for orcs. it was released maybe 5-10 years ago
Okay so FWIW, I found the render target issue, each "view", basically a pass in BGFX, can only have one render target bound, but I was reusing a worker pass for different targets
user92578
Ended up implementing swapping view IDs behind the scenes when the target changes, but need to consider if I can come up with a better approach for random worker renderings to a target
One of my wife's clinics teamed up w/ a food pantry. They got a big shipment of produce that was too iffy to offer. She brought some of it home & 90% went into my compost bins. But I thought - hey I can totes save these bags of green onions.