- Vector r = dir_trans.transform(Vector(0, -radius, 0));
- result.position = pos-r+Transform::rotation(a, Vector(0, 0, 1)).transform(r);
+ result.position = transform.transform(Vector(sin(a)*radius, (1-cos(a))*radius, 0));
Angle a = Geometry::atan2(v.y, v.x)+Angle::quarter_turn()-dir;
if(radius<0)
a = Angle::half_turn()-a;
Angle a = Geometry::atan2(v.y, v.x)+Angle::quarter_turn()-dir;
if(radius<0)
a = Angle::half_turn()-a;
- result.position = pos-r+Transform::rotation(a, Vector(0, 0, 1)).transform(r);
+ result.position = transform.transform(Vector(sin(a)*radius, (1-cos(a))*radius, 0));
float d = min(max(dot(dir_vec, v), 0.0f), length);
result.position = pos+dir_vec*d;
result.rotation = dir;
float d = min(max(dot(dir_vec, v), 0.0f), length);
result.position = pos+dir_vec*d;
result.rotation = dir;
shapes.push_back(&bounds);
shape = new Geometry::TransformedShape<float, 3>(
Geometry::Intersection<float, 3>::from_iterator_range(shapes.begin(), shapes.end()),
shapes.push_back(&bounds);
shape = new Geometry::TransformedShape<float, 3>(
Geometry::Intersection<float, 3>::from_iterator_range(shapes.begin(), shapes.end()),
}
else
{
// TODO Get the track profile dimensions from somewhere
shape = new Geometry::TransformedShape<float, 3>(
Geometry::Box<float>(length, 0.04, 0.01),
}
else
{
// TODO Get the track profile dimensions from somewhere
shape = new Geometry::TransformedShape<float, 3>(
Geometry::Box<float>(length, 0.04, 0.01),