Hackerjoe
(Hackerjoe)
March 23, 2014, 12:23am
1
Hey, I wanna know how to setup a Uworld class so I can start doing some linetrace(raycasting) through PhysX. I just wanna do it from the third person controller to what ever it hits.
Here is the doc to UWorld::LineTraceSingle
So is Uworld already there? Do I have to make a Uworld subclass?
Thanks in advance.
Hackerjoe
(Hackerjoe)
March 23, 2014, 12:52am
2
Rama
(Rama)
March 23, 2014, 3:00am
3
#UWorld
Every UObject can now access UWorld!
Like so
Say you have a UObject Class, MyObj
You can do
UWorld* TheWorld = MyObj->GetWorld();
If(!TheWorld) return;
//~~~~~~~~~~~~~~~
//now you can use TheWorld
TheWorld->Functions
#TObjectIterator
If you dont have access to any UObjects in your current function context, use this
TObjectIterator<APlayerController> ThePC;
if(!ThePC) return;
UWorld* TheWorld = ThePC->GetWorld();
this finds the player controller that exists in the world
If you are doing in-editor physx stuff the above wont work
I assume you are doing this at game run time.
Rama