21 if (name ==
"default") {
30 INLINE
void EggVertexUV::
31 set_name(
const std::string &name) {
41 return has_w() ? 3 : 2;
50 return (_flags & F_has_w) != 0;
58 nassertr(!
has_w(), LTexCoordd::zero());
59 return LTexCoordd(_uvw[0], _uvw[1]);
77 set_uv(
const LTexCoordd &uv) {
78 _uvw.set(uv[0], uv[1], 0.0);
87 set_uvw(
const LTexCoord3d &uvw) {
95 INLINE
bool EggVertexUV::
97 return (_flags & F_has_tangent) != 0;
103 INLINE
bool EggVertexUV::
104 has_tangent4()
const {
105 return (_flags & F_has_tangent4) != 0;
111 INLINE
const LNormald &EggVertexUV::
112 get_tangent()
const {
113 nassertr(has_tangent(), _tangent);
120 INLINE LVecBase4d EggVertexUV::
121 get_tangent4()
const {
122 LVecBase4d tangent4(_tangent, 1.0);
123 nassertr_always(has_tangent(), tangent4);
124 if (_flags & F_flip_computed_binormal) {
133 INLINE
void EggVertexUV::
134 set_tangent(
const LNormald &tangent) {
136 _flags |= F_has_tangent;
137 _flags &= ~(F_has_tangent4 | F_flip_computed_binormal);
146 _tangent = tangent.get_xyz();
147 _flags |= F_has_tangent4 | F_has_tangent;
148 if (tangent[3] < 0.0) {
149 _flags |= F_flip_computed_binormal;
151 _flags &= ~F_flip_computed_binormal;
158 INLINE
void EggVertexUV::
160 _flags &= ~F_has_tangent;
166 INLINE
bool EggVertexUV::
167 has_binormal()
const {
168 return (_flags & F_has_binormal) != 0;
174 INLINE
const LNormald &EggVertexUV::
175 get_binormal()
const {
176 nassertr(has_binormal(), _binormal);
183 INLINE
void EggVertexUV::
184 set_binormal(
const LNormald &binormal) {
185 _binormal = binormal;
186 _flags |= F_has_binormal;
192 INLINE
void EggVertexUV::
194 _flags &= ~F_has_binormal;
static std::string filter_name(const std::string &name)
Returns the actual name that should be set for a given name string.
LTexCoordd get_uv() const
Returns the texture coordinate pair, if get_num_dimensions() is 2.
bool has_w() const
Returns true if the texture coordinate has a third, w component, false if it is just a normal 2-d tex...
void set_uv(const LTexCoordd &texCoord)
Sets the texture coordinate pair.
int get_num_dimensions() const
Returns the number of components of the texture coordinate set.
void set_uvw(const LTexCoord3d &texCoord)
Sets the texture coordinate triple.
void set_tangent4(const LVecBase4d &tangent)
Sets the tangent vector, along with a fourth parameter that is multiplied with the result of cross(no...
const LTexCoord3d & get_uvw() const
Returns the texture coordinate triple, if get_num_dimensions() is 3.