Example #1
0
Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryParameters> &psq){

	ShapeRestInfo sri;

	bool res = rest_info(psq->shape,psq->transform,psq->margin,&sri,psq->exclude,psq->layer_mask,psq->object_type_mask);
	Dictionary r(true);
	if (!res)
		return r;

	r["point"]=sri.point;
	r["normal"]=sri.normal;
	r["rid"]=sri.rid;
	r["collider_id"]=sri.collider_id;
	r["shape"]=sri.shape;
	r["linear_velocity"]=sri.linear_velocity;

	return r;
}
Example #2
0
Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQueryParameters> &p_shape_query) {

	ShapeRestInfo sri;

	bool res = rest_info(p_shape_query->shape, p_shape_query->transform, p_shape_query->motion, p_shape_query->margin, &sri, p_shape_query->exclude, p_shape_query->collision_layer, p_shape_query->object_type_mask);
	Dictionary r;
	if (!res)
		return r;

	r["point"] = sri.point;
	r["normal"] = sri.normal;
	r["rid"] = sri.rid;
	r["collider_id"] = sri.collider_id;
	r["shape"] = sri.shape;
	r["linear_velocity"] = sri.linear_velocity;
	r["metadata"] = sri.metadata;

	return r;
}