3D line segment AABB collision, with hit normal?

I’m embarrassed I can’t find this, but I’m wanting to detect intersection with a 3D line segment (not an infinite ray) with a 3D AABB, the AABB being defined as two Vec3f’s which represent the Min and Max extents. So the AABB can be arbitrarily-sized. I also need the surface normal of the AABB, if there was a hit.

From looking at similar algorithms I at least know it seems good to calculate the inverse direction of the line beforehand, at least, if you’re needing to check against multiple AABBs per frame.

I have

struct AABB {     VEC3F min;     VEC3F max; };  // a and b representing start/end points of the line segment // returns true if intersects, also fills out "normal" if true bool LineIntersectsAABB(const VEC3F& a, const VEC3F& b,     const VEC3F& inv_dir, const AABB& aabb,     VEC3F* normal); 

The implementations I’ve found either do not find the hit normal, and/or they’re intended for boxes/cubes where the three dimensions of the box are always equal length, which doesn’t work for me. Implementations seem to vary greatly, which is confusing for me (who is trying to understand it), and, considering that I need the hit normal, I’d imagine that that may rule out certain implementations.

Do I have to write #pragma multi_compile_fwdbase in ShadeLab?

Recently I met a problem that if I don’t write #pragma multi_compile_fwdbase then the shadows will never be shown. However, if I don’t want shadows, it’s ok without this command.

Actually there are two questions I want to know.

  1. Shall I always write this command if my pass’s tag is set to "LightMode" = "ForwardBase"?

  2. Recently I checked my custom shaders, a lot of shaders have no this command but all of them are working well, will it be a problem in the future?

Dev Stream Platforms?

Twitch is arguably the de-facto platform for streaming game related content. in researching this topic, several developers already proudly share some of their development, and my press releases through that platform.

my question is this: if streaming, and community involvement are going to play a larger role in a game’s development, what are the best platforms to use?

I ask because while Twitch would seem the obvious candidate, and multi-casting is a thing, several active streamers iv’e discussed the topic with have told me that Twitch is not the place to have any kind of constructive feedback, or discussion. While there are certainly exceptions, this is giving me pause from just defaulting to that platform. A center point of the idea is to bring players, users, and other devs, casually into the development sphere, to let the community feel like they helped make the game, and give aspiring devs a peer through the veil in order to better understand development as a process.

Thank you for your time.

Unity not resolving android dependencies and only returns resolution success

I just added some android plugins like in app purchase and advertisement and game analytics.

As i remember in previous installations unity downloaded many libraries for plugins on resolve. Now it only returns “resolution success” with no library added and it doeant work in final build.

Can any one tell what is the problem??

UE4. Reload CDO default values?

My aim is make difficulty system that will edit Class Default Object values for any specified class. It’s fastest way to make any properties that will dependent to difficulty by game designer (Class. Property name. Modifier – mult/add).

So. I can get ClassDefaultObject from UClass. This object has default values that will be used when class will be instantiated. If I edit them the new object will contains edited values too.

The best way is recreate ClassDefaultObject? As I see in the code, GetDefaultObject method can construct this object if it does not exists. So, tried to destroy and null the ClassDefaultObject and call GetDefaultObject.

 UObject* CDO = ClassToEdit->ClassDefaultObject;  CDO->ConditionalBeginDestroy();  ClassToEdit->ClassDefaultObject = nullptr;  ClassToEdit->GetDefaultObject(true); 

This code makes new CDO, but this CDO has wrong values, not the default that I seen before. This CDO has parent’s default values. Why so?

Okay. It does’t helps. Package reloading? I tried this:

 UPackage* package = ClassToEdit->GetOuterUPackage();  package = ReloadPackage(package, 0); 

But this causes very bad effects (in PIE). Every object that links to this object will be reloaded too? Each BeginPlay in my level fires again after reloading. It’s not good. I also got various errors/condition failures/assertions after this operation.

So, can I reload CDO defaults without full reload? I want to return previous (true) defaults to my CDO. Is that possible?