| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- // Filename: eggTexture.I
- // Created by: drose (18Jan99)
- //
- ////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::Assignment operator
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture &EggTexture::
- operator = (const string &filename) {
- EggFilenameNode::operator = (filename);
- return *this;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::Assignment operator
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture &EggTexture::
- operator = (const char *filename) {
- EggFilenameNode::operator = (filename);
- return *this;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::Assignment operator
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture &EggTexture::
- operator = (const Filename &filename) {
- EggFilenameNode::operator = (filename);
- return *this;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_format
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_format(Format format) {
- _format = format;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_format
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::Format EggTexture::
- get_format() const {
- return _format;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_wrap_mode
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_wrap_mode(WrapMode mode) {
- _wrap_mode = mode;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_wrap_mode
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::WrapMode EggTexture::
- get_wrap_mode() const {
- return _wrap_mode;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_wrap_u
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_wrap_u(WrapMode mode) {
- _wrap_u = mode;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_wrap_u
- // Access: Public
- // Description: Returns the amount specified for U wrap. This may be
- // unspecified, even if there is an overall wrap value.
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::WrapMode EggTexture::
- get_wrap_u() const {
- return _wrap_u;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::determine_wrap_u
- // Access: Public
- // Description: Determines the appropriate wrap in the U direction.
- // This is different from get_wrap_u() in that if the U
- // wrap is unspecified, it returns the overall wrap
- // value.
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::WrapMode EggTexture::
- determine_wrap_u() const {
- return (_wrap_u == WM_unspecified) ? get_wrap_mode() : get_wrap_u();
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_wrap_v
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_wrap_v(WrapMode mode) {
- _wrap_v = mode;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_wrap_v
- // Access: Public
- // Description: Returns the amount specified for V wrap. This may be
- // unspecified, even if there is an overall wrap value.
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::WrapMode EggTexture::
- get_wrap_v() const {
- return _wrap_v;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::determine_wrap_v
- // Access: Public
- // Description: Determines the appropriate wrap in the V direction.
- // This is different from get_wrap_v() in that if the U
- // wrap is unspecified, it returns the overall wrap
- // value.
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::WrapMode EggTexture::
- determine_wrap_v() const {
- return (_wrap_v == WM_unspecified) ? get_wrap_mode() : get_wrap_v();
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_minfilter
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_minfilter(FilterType type) {
- _minfilter = type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_minfilter
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::FilterType EggTexture::
- get_minfilter() const {
- return _minfilter;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_magfilter
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_magfilter(FilterType type) {
- _magfilter = type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_magfilter
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::FilterType EggTexture::
- get_magfilter() const {
- return _magfilter;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_magfilteralpha
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_magfilteralpha(FilterType type) {
- _magfilteralpha = type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_magfilteralpha
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::FilterType EggTexture::
- get_magfilteralpha() const {
- return _magfilteralpha;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_magfiltercolor
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_magfiltercolor(FilterType type) {
- _magfiltercolor = type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_magfiltercolor
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::FilterType EggTexture::
- get_magfiltercolor() const {
- return _magfiltercolor;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_env_type
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_env_type(EnvType type) {
- _env_type = type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_env_type
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE EggTexture::EnvType EggTexture::
- get_env_type() const {
- return _env_type;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::set_transform
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- set_transform(const LMatrix3d &transform) {
- _transform = transform;
- _has_transform = true;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::clear_transform
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE void EggTexture::
- clear_transform() {
- _transform = LMatrix3d::ident_mat();
- _has_transform = false;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::has_transform
- // Access: Public
- // Description: Returns true if a texture matrix transform has been
- // specified for the texture (even if the transform is
- // identity).
- ////////////////////////////////////////////////////////////////////
- INLINE bool EggTexture::
- has_transform() const {
- return _has_transform;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::get_transform
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE LMatrix3d EggTexture::
- get_transform() const {
- nassertr(_has_transform, LMatrix3d::ident_mat());
- return _transform;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: EggTexture::transform_is_identity()
- // Access: Public
- // Description: Returns true if no texture matrix transform has been
- // specified, or if the one specified is the identity
- // transform. Returns false only if a nonidentity
- // transform has been applied.
- ////////////////////////////////////////////////////////////////////
- INLINE bool EggTexture::
- transform_is_identity() const {
- return (!_has_transform ||
- _transform.almost_equal(LMatrix3d::ident_mat(), 0.0001));
- }
- ////////////////////////////////////////////////////////////////////
- // Function: UniqueEggTextures::Constructor
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE UniqueEggTextures::
- UniqueEggTextures(int eq) : _eq(eq) {
- }
- ////////////////////////////////////////////////////////////////////
- // Function: UniqueEggTextures::Function operator
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE bool UniqueEggTextures::
- operator ()(const EggTexture *t1, const EggTexture *t2) const {
- return t1->sorts_less_than(*t2, _eq);
- }
|