#include <PVLE/Export.h>
#include <osg/Node>
#include <osg/NodeCallback>
#include <osg/Vec3f>
#include <osg/Vec4f>
#include <osg/Vec3d>
#include <osg/Vec4d>
#include <osg/Quat>
#include <osg/GraphicsContext>
#include <boost/filesystem/path.hpp>
#include <osgDB/ReaderWriter>
Go to the source code of this file.
Namespaces | |
namespace | osg |
OSG missing operators, added by PVLE. | |
namespace | osgDB |
osgDB extensions that take a boost::filesystem::path instead of a std::string for directories and files names. | |
Functions | |
Vec3f | osg::operator* (const Vec3f &v, const Quat &q) |
Missing operator in OSG. | |
Vec3d | osg::operator* (const Vec3d &v, const Quat &q) |
Missing operator in OSG. | |
Vec4f | osg::operator* (const Vec4f &v, const Quat &q) |
Missing operator in OSG. | |
Vec4d | osg::operator* (const Vec4d &v, const Quat &q) |
Missing operator in OSG. | |
osg::Vec3f | invertY (const osg::Vec3f &v) |
osg::Vec3d | invertY (const osg::Vec3d &v) |
osg::Vec4f | invertY (const osg::Vec4f &v) |
osg::Vec4d | invertY (const osg::Vec4d &v) |
osg::Vec3f | multX (const osg::Vec3f &v, float r) |
osg::Vec3d | multX (const osg::Vec3d &v, double r) |
osg::Vec4f | multX (const osg::Vec4f &v, float r) |
osg::Vec4d | multX (const osg::Vec4d &v, double r) |
osg::Vec3f | multY (const osg::Vec3f &v, float r) |
osg::Vec3d | multY (const osg::Vec3d &v, double r) |
osg::Vec4f | multY (const osg::Vec4f &v, float r) |
osg::Vec4d | multY (const osg::Vec4d &v, double r) |
osg::Vec3f | multZ (const osg::Vec3f &v, float r) |
osg::Vec3d | multZ (const osg::Vec3d &v, double r) |
osg::Vec4f | multZ (const osg::Vec4f &v, float r) |
osg::Vec4d | multZ (const osg::Vec4d &v, double r) |
osg::Vec4f | multW (const osg::Vec4f &v, float r) |
osg::Vec4d | multW (const osg::Vec4d &v, double r) |
osg::Vec3f | toVec3 (const osg::Vec4f &v) |
osg::Vec3d | toVec3 (const osg::Vec4d &v) |
PVLE_EXPORT float | computeAngle (const osg::Vec3f &v1, const osg::Vec3f &v2, const osg::Vec3f reference) |
Computes angle (in [-PI; PI]) between two vectors, using a reference vector for the sign of the angle. | |
PVLE_EXPORT double | computeAngle (const osg::Vec3d &v1, const osg::Vec3d &v2, const osg::Vec3d reference) |
PVLE_EXPORT bool | hasUpdateCallbackType (const osg::Node &node, const std::type_info &type) |
Add an update callback to a node, even if a callback already exists, but only if another one of the same type doesn't exist or is nested. | |
PVLE_EXPORT osg::Image * | createNormalMap (const osg::Image *image) |
Creates a normal map from a bump map (Image can be 2D or 3D). | |
PVLE_EXPORT osg::Image * | createHeightColorization (const osg::HeightField *pHF) |
Creates a 2D image to be used as a texture for a height field. | |
PVLE_EXPORT osg::StateSet * | create1DTextureHeightColorization (const osg::HeightField *pHF) |
Looks much like createHeightColorization(), but uses a Texture1D (currently in dev). | |
PVLE_EXPORT void | spotLightProcessing (osg::Image *pImage, float cutoff, float exponent, float constantAttenuation, float linearAttenuation, float quadraticAttenuation, float distFactor) |
Processes an image by writing the alpha channel depending on spotlight parameters. | |
osg::Vec4::value_type | luminance (const osg::Vec4 &color) |
Computes the luminance of a color (takes into account the alpha component). | |
PVLE_EXPORT osg::GraphicsContext::ScreenSettings | getClosestFullscreenResolution (const osg::GraphicsContext::ScreenIdentifier &si, const osg::GraphicsContext::ScreenSettings &resolution) |
Returns the closest screen resolution supported. | |
PVLE_EXPORT std::ostream & | operator<< (std::ostream &stream, const osg::GraphicsContext::ScreenSettings &settings) |
PVLE_EXPORT osg::Image * | osgDB::readImageFile (const boost::filesystem::path &path, const osgDB::ReaderWriter::Options *options) |
Calls readImageFile(const std::string&, const ReaderWriter::Options*) with boost::filesystem::path and throws an exception if the file has not been loaded. | |
PVLE_EXPORT osg::Image * | osgDB::readImageFile (const boost::filesystem::path &path) |
Calls readImageFile(const std::string&) with boost::filesystem::path and throws an exception if the file has not been loaded. | |
PVLE_EXPORT void | osgDB::writeImageFile (const osg::Image &image, const boost::filesystem::path &path) |
Calls writeImageFile(const osg::Image&, const std::string&) with boost::filesystem::path and throws an exception if the file has not been loaded. | |
PVLE_EXPORT osg::Node * | osgDB::readNodeFile (const boost::filesystem::path &path, const osgDB::ReaderWriter::Options *options) |
Calls readNodeFile(const std::string&, const ReaderWriter::Options*) with boost::filesystem::path and throws an exception if the file has not been loaded. | |
PVLE_EXPORT osg::Node * | osgDB::readNodeFile (const boost::filesystem::path &path) |
Calls readNodeFile(const std::string&) with boost::filesystem::path and throws an exception if the file has not been loaded. | |
PVLE_EXPORT void | osgDB::writeNodeFile (const osg::Node &node, const boost::filesystem::path &path) |
Calls writeNodeFile(const osg::Node&, const std::string&) with boost::filesystem::path and throws an exception if the file has not been loaded. |
This file is not named "Utility.h" since there's already one in 'Physics' directory (Avoids confsion, and avoids a collision in '.o' / '.obj' files if they're in the same directory).
Definition in file Utility3D.h.
PVLE_EXPORT double computeAngle | ( | const osg::Vec3d & | v1, | |
const osg::Vec3d & | v2, | |||
const osg::Vec3d | reference | |||
) |
Definition at line 61 of file Utility3D.cpp.
PVLE_EXPORT float computeAngle | ( | const osg::Vec3f & | v1, | |
const osg::Vec3f & | v2, | |||
const osg::Vec3f | reference | |||
) |
Computes angle (in [-PI; PI]) between two vectors, using a reference vector for the sign of the angle.
Definition at line 55 of file Utility3D.cpp.
PVLE_EXPORT osg::StateSet* create1DTextureHeightColorization | ( | const osg::HeightField * | pHF | ) |
Looks much like createHeightColorization(), but uses a Texture1D (currently in dev).
Definition at line 332 of file Utility3D.cpp.
PVLE_EXPORT osg::Image* createHeightColorization | ( | const osg::HeightField * | pHF | ) |
Creates a 2D image to be used as a texture for a height field.
This image can be modified after if necessary.
Create a similar function that sets verticies color of a height field.
Definition at line 300 of file Utility3D.cpp.
References ASSERT, clamp(), and CartographyColorizator::valsFromHF().
PVLE_EXPORT osg::Image* createNormalMap | ( | const osg::Image * | image | ) |
Creates a normal map from a bump map (Image can be 2D or 3D).
RGB/RGBA source formats are handled using the first encountered color channel (Endian-dependant!). Need to average the 3 source colors.
Definition at line 124 of file Utility3D.cpp.
References LOG_NOTICE, and LOG_WARN.
PVLE_EXPORT osg::GraphicsContext::ScreenSettings getClosestFullscreenResolution | ( | const osg::GraphicsContext::ScreenIdentifier & | si, | |
const osg::GraphicsContext::ScreenSettings & | resolution | |||
) |
Returns the closest screen resolution supported.
It tries to find the closest width and height, and then the closest color depth, and finally the highest refresh rate.
Definition at line 477 of file Utility3D.cpp.
References ASSERT, and LOG_NOTICE.
PVLE_EXPORT bool hasUpdateCallbackType | ( | const osg::Node & | node, | |
const std::type_info & | type | |||
) |
Add an update callback to a node, even if a callback already exists, but only if another one of the same type doesn't exist or is nested.
Definition at line 44 of file Utility3D.cpp.
osg::Vec4d invertY | ( | const osg::Vec4d & | v | ) | [inline] |
Definition at line 62 of file Utility3D.h.
osg::Vec4f invertY | ( | const osg::Vec4f & | v | ) | [inline] |
Definition at line 61 of file Utility3D.h.
osg::Vec3d invertY | ( | const osg::Vec3d & | v | ) | [inline] |
Definition at line 60 of file Utility3D.h.
osg::Vec3f invertY | ( | const osg::Vec3f & | v | ) | [inline] |
Definition at line 59 of file Utility3D.h.
osg::Vec4::value_type luminance | ( | const osg::Vec4 & | color | ) | [inline] |
Computes the luminance of a color (takes into account the alpha component).
Definition at line 117 of file Utility3D.h.
osg::Vec4d multW | ( | const osg::Vec4d & | v, | |
double | r | |||
) | [inline] |
Definition at line 80 of file Utility3D.h.
osg::Vec4f multW | ( | const osg::Vec4f & | v, | |
float | r | |||
) | [inline] |
Definition at line 79 of file Utility3D.h.
osg::Vec4d multX | ( | const osg::Vec4d & | v, | |
double | r | |||
) | [inline] |
Definition at line 67 of file Utility3D.h.
osg::Vec4f multX | ( | const osg::Vec4f & | v, | |
float | r | |||
) | [inline] |
Definition at line 66 of file Utility3D.h.
osg::Vec3d multX | ( | const osg::Vec3d & | v, | |
double | r | |||
) | [inline] |
Definition at line 65 of file Utility3D.h.
osg::Vec3f multX | ( | const osg::Vec3f & | v, | |
float | r | |||
) | [inline] |
Definition at line 64 of file Utility3D.h.
osg::Vec4d multY | ( | const osg::Vec4d & | v, | |
double | r | |||
) | [inline] |
Definition at line 72 of file Utility3D.h.
osg::Vec4f multY | ( | const osg::Vec4f & | v, | |
float | r | |||
) | [inline] |
Definition at line 71 of file Utility3D.h.
osg::Vec3d multY | ( | const osg::Vec3d & | v, | |
double | r | |||
) | [inline] |
Definition at line 70 of file Utility3D.h.
osg::Vec3f multY | ( | const osg::Vec3f & | v, | |
float | r | |||
) | [inline] |
Definition at line 69 of file Utility3D.h.
osg::Vec4d multZ | ( | const osg::Vec4d & | v, | |
double | r | |||
) | [inline] |
Definition at line 77 of file Utility3D.h.
osg::Vec4f multZ | ( | const osg::Vec4f & | v, | |
float | r | |||
) | [inline] |
Definition at line 76 of file Utility3D.h.
osg::Vec3d multZ | ( | const osg::Vec3d & | v, | |
double | r | |||
) | [inline] |
Definition at line 75 of file Utility3D.h.
osg::Vec3f multZ | ( | const osg::Vec3f & | v, | |
float | r | |||
) | [inline] |
Definition at line 74 of file Utility3D.h.
PVLE_EXPORT std::ostream& operator<< | ( | std::ostream & | stream, | |
const osg::GraphicsContext::ScreenSettings & | settings | |||
) |
Definition at line 553 of file Utility3D.cpp.
PVLE_EXPORT void spotLightProcessing | ( | osg::Image * | pImage, | |
float | cutoff, | |||
float | exponent, | |||
float | constantAttenuation, | |||
float | linearAttenuation, | |||
float | quadraticAttenuation, | |||
float | distFactor | |||
) |
Processes an image by writing the alpha channel depending on spotlight parameters.
Definition at line 411 of file Utility3D.cpp.
References ASSERT, clamp_copy(), and LOG_NOTICE.
osg::Vec3d toVec3 | ( | const osg::Vec4d & | v | ) | [inline] |
Definition at line 84 of file Utility3D.h.
osg::Vec3f toVec3 | ( | const osg::Vec4f & | v | ) | [inline] |