Exemplo n.º 1
0
template<UnsignedInt dimensions> void AxisAlignedBox<dimensions>::applyTransformationMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) {
    _transformedMin = matrix.transformPoint(_min);
    _transformedMax = matrix.transformPoint(_max);
}
Exemplo n.º 2
0
template<UnsignedInt dimensions> void Capsule<dimensions>::applyTransformationMatrix(const typename DimensionTraits<dimensions>::MatrixType& matrix) {
    _transformedA = matrix.transformPoint(_a);
    _transformedB = matrix.transformPoint(_b);
    Float scaling = (matrix.rotationScaling()*typename DimensionTraits<dimensions>::VectorType(1/Constants::sqrt3())).length();
    _transformedRadius = scaling*_radius;
}
Exemplo n.º 3
0
template<UnsignedInt dimensions> void ForceRenderer<dimensions>::draw(const typename DimensionTraits<dimensions, Float>::MatrixType& transformationMatrix, SceneGraph::AbstractCamera<dimensions, Float>& camera) {
    shader->setTransformationProjectionMatrix(camera.projectionMatrix()*Implementation::forceRendererTransformation<dimensions>(transformationMatrix.transformPoint(forcePosition), force)*DimensionTraits<dimensions, Float>::MatrixType::scaling(typename DimensionTraits<dimensions, Float>::VectorType(options->scale())))
        .setColor(options->color())
        .use();
    mesh->draw();
}
Exemplo n.º 4
0
template<UnsignedInt dimensions> Cylinder<dimensions> Cylinder<dimensions>::transformed(const typename DimensionTraits<dimensions, Float>::MatrixType& matrix) const {
    return Cylinder<dimensions>(matrix.transformPoint(_a), matrix.transformPoint(_b), matrix.uniformScaling()*_radius);
}
Exemplo n.º 5
0
template<UnsignedInt dimensions> AxisAlignedBox<dimensions> AxisAlignedBox<dimensions>::transformed(const typename DimensionTraits<dimensions, Float>::MatrixType& matrix) const {
    return AxisAlignedBox<dimensions>(matrix.transformPoint(_min),
                                      matrix.transformPoint(_max));
}
Exemplo n.º 6
0
template<UnsignedInt dimensions> Sphere<dimensions> Sphere<dimensions>::transformed(const typename DimensionTraits<dimensions, Float>::MatrixType& matrix) const {
    return Sphere<dimensions>(matrix.transformPoint(_position), matrix.uniformScaling()*_radius);
}