Esempio n. 1
0
template<UnsignedInt dimensions> void Listener<dimensions>::clean(const MatrixTypeFor<dimensions, Float>& absoluteTransformationMatrix) {
    if(!isActive()) {
        /* Only clean if this Listener is active */
        return;
    }

    Renderer::setListenerPosition(soundTransformation().transformVector(Vector3::pad(absoluteTransformationMatrix.translation())));

    const Vector3 fwd = soundTransformation().transformVector(-padMatrix4(absoluteTransformationMatrix).backward());
    const Vector3 up = soundTransformation().transformVector(padMatrix4(absoluteTransformationMatrix).up());

    Renderer::setListenerOrientation(fwd, up);

    Renderer::setListenerGain(_gain);

    /** @todo velocity */
}
Esempio n. 2
0
template<UnsignedInt dimensions> Sphere<dimensions> Sphere<dimensions>::transformed(const MatrixTypeFor<dimensions, Float>& matrix) const {
    return Sphere<dimensions>(matrix.transformPoint(_position), matrix.uniformScaling()*_radius);
}
Esempio n. 3
0
template<UnsignedInt dimensions> Line<dimensions> Line<dimensions>::transformed(const MatrixTypeFor<dimensions, Float>& matrix) const {
    return Line<dimensions>(matrix.transformPoint(_a),
                            matrix.transformPoint(_b));
}
Esempio n. 4
0
template<UnsignedInt dimensions> void ForceRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) {
    _shader->setTransformationProjectionMatrix(camera.projectionMatrix()*Implementation::forceRendererTransformation<dimensions>(transformationMatrix.transformPoint(_forcePosition), _force)*MatrixTypeFor<dimensions, Float>::scaling(VectorTypeFor<dimensions, Float>{_options->scale()}))
        .setColor(_options->color());
    _mesh->draw(*_shader);
}
Esempio n. 5
0
template<UnsignedInt dimensions> Capsule<dimensions> Capsule<dimensions>::transformed(const MatrixTypeFor<dimensions, Float>& matrix) const {
    return Capsule<dimensions>(matrix.transformPoint(_a), matrix.transformPoint(_b), matrix.uniformScaling()*_radius);
}
Esempio n. 6
0
template<UnsignedInt dimensions> Point<dimensions> Point<dimensions>::transformed(const MatrixTypeFor<dimensions, Float>& matrix) const {
    return Point<dimensions>(matrix.transformPoint(_position));
}