godotengine / godotengine/godot-cpp

'RayParameters' is not a member of 'godot::PhysicsDirectSpaceState3D'

Open
#969 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

Hey,
first of all - thank you all for your great work!

I'm trying to initiate a raycast in my gdextension and can't get it running.

```
PhysicsDirectSpaceState3D::RayParameters ray_params;
ray_params.from = get_global_transform().origin;
ray_params.to = get_global_transform().origin + motion;
ray_params.exclude = excluded_objects;
ray_params.collision_mask = mask;

PhysicsDirectSpaceState3D::RayResult r;
bool intersected = get_world_3d()->get_direct_space_state()->intersect_ray(ray_params, r);
if (intersected)
{
real_t dist = get_global_transform().origin.distance_to(r.position);
dist -= margin;
motion_delta = dist / (spring_length);
}
```

This is the snippet I'm trying to get running but I get the error: 'RayParameters' is not a member of 'godot::PhysicsDirectSpaceState3D'. And while in the godot source it is a member - in godot-cpp it is not.

I'm really inexperienced in working with gdextension and also rather new in c++ in general, so I'm expecting that I missed something but I checked the whole godot-cpp and can't find any trace of RayParameters. Is it really missing or am I on the wrong path here?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.