Package com.raylib
Class RayCollision
java.lang.Object
com.raylib.RayCollision
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MemorySegment
The native FFI MemorySegment that holds the data this object wraps. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct with auto memory allocator and fields initialized to zero.RayCollision
(boolean hit, float distance, Vector3 point, Vector3 normal) Construct with auto memory allocator and fields initialized as specifiedRayCollision
(MemorySegment memorySegment) Construct by wrapping around an already allocated MemorySegment, perhaps from another objectRayCollision
(SegmentAllocator arena) Construct with your owm memory allocator and fields not initializedRayCollision
(SegmentAllocator arena, boolean hit, float distance, Vector3 point, Vector3 normal) Construct with your own memory allocator and fields initialized as specified -
Method Summary
Modifier and TypeMethodDescriptionstatic RayCollision
allocateArray
(long elementCount) Allocate an array of RayCollisionstatic RayCollision
allocateArray
(long elementCount, SegmentAllocator allocator) Allocate an array of RayCollisionboolean
Equality is tested on basis of both wrapper objects must refer to same native memory location to be considered equalgetArrayElement
(int index) float
Distance to the nearest hitboolean
getHit()
Did the ray hit something?Surface normal of hitgetPoint()
Point of the nearest hitint
hashCode()
setDistance
(float value) Distance to the nearest hitsetHit
(boolean value) Did the ray hit something?Surface normal of hitPoint of the nearest hit
-
Field Details
-
memorySegment
The native FFI MemorySegment that holds the data this object wraps.
-
-
Constructor Details
-
RayCollision
public RayCollision()Construct with auto memory allocator and fields initialized to zero. -
RayCollision
Construct with your owm memory allocator and fields not initialized -
RayCollision
Construct by wrapping around an already allocated MemorySegment, perhaps from another object -
RayCollision
Construct with auto memory allocator and fields initialized as specified- Parameters:
hit
- Did the ray hit something?distance
- Distance to the nearest hitpoint
- Point of the nearest hitnormal
- Surface normal of hit
-
RayCollision
public RayCollision(SegmentAllocator arena, boolean hit, float distance, Vector3 point, Vector3 normal) Construct with your own memory allocator and fields initialized as specified- Parameters:
hit
- Did the ray hit something?distance
- Distance to the nearest hitpoint
- Point of the nearest hitnormal
- Surface normal of hit
-
-
Method Details
-
equals
-
hashCode
-
getArrayElement
-
allocateArray
Allocate an array of RayCollision -
allocateArray
Allocate an array of RayCollision -
getHit
public boolean getHit()Did the ray hit something? -
setHit
Did the ray hit something? -
getDistance
public float getDistance()Distance to the nearest hit -
setDistance
Distance to the nearest hit -
getPoint
Point of the nearest hit -
setPoint
Point of the nearest hit -
getNormal
Surface normal of hit -
setNormal
Surface normal of hit
-