mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Added support for pad regions
This commit is contained in:
parent
662491fb7f
commit
e32bf5cbf3
@ -260,12 +260,16 @@ set_uv_range_cube(int face) {
|
|||||||
// Function: CardMaker::set_uv_range
|
// Function: CardMaker::set_uv_range
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description: Sets the range of UV's that will be applied to the
|
// Description: Sets the range of UV's that will be applied to the
|
||||||
// vertices appropriately to play a specified Movie.
|
// vertices appropriately to show the non-pad region
|
||||||
|
// of the texture.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void CardMaker::
|
void CardMaker::
|
||||||
set_uv_range(const MovieTexture *movie) {
|
set_uv_range(const Texture *tex) {
|
||||||
double maxu = (movie->get_video_width()*1.0) / movie->get_x_size();
|
nassertv(tex->get_texture_type() == Texture::TT_2d_texture);
|
||||||
double maxv = (movie->get_video_height()*1.0) / movie->get_y_size();
|
int nonpadx = tex->get_x_size() - tex->get_pad_x_size();
|
||||||
|
int nonpady = tex->get_y_size() - tex->get_pad_y_size();
|
||||||
|
double maxu = (nonpadx*1.0) / tex->get_x_size();
|
||||||
|
double maxv = (nonpady*1.0) / tex->get_y_size();
|
||||||
set_uv_range(TexCoordf(0.0,0.0), TexCoordf(maxu,maxv));
|
set_uv_range(TexCoordf(0.0,0.0), TexCoordf(maxu,maxv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "pandaNode.h"
|
#include "pandaNode.h"
|
||||||
#include "pointerTo.h"
|
#include "pointerTo.h"
|
||||||
#include "namable.h"
|
#include "namable.h"
|
||||||
#include "movieTexture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : CardMaker
|
// Class : CardMaker
|
||||||
@ -44,7 +44,7 @@ PUBLISHED:
|
|||||||
void set_uv_range(const TexCoord3f &ll, const TexCoord3f &lr, const TexCoord3f &ur, const TexCoord3f &ul);
|
void set_uv_range(const TexCoord3f &ll, const TexCoord3f &lr, const TexCoord3f &ur, const TexCoord3f &ul);
|
||||||
void set_uv_range(const LVector4f &x, const LVector4f &y, const LVector4f &z);
|
void set_uv_range(const LVector4f &x, const LVector4f &y, const LVector4f &z);
|
||||||
void set_uv_range_cube(int face);
|
void set_uv_range_cube(int face);
|
||||||
void set_uv_range(const MovieTexture *frame);
|
void set_uv_range(const Texture *tex);
|
||||||
|
|
||||||
INLINE void set_has_uvs(bool flag);
|
INLINE void set_has_uvs(bool flag);
|
||||||
INLINE void set_has_3d_uvs(bool flag);
|
INLINE void set_has_3d_uvs(bool flag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user