Browse Source

fix CardMaker for y-up

David Rose 14 years ago
parent
commit
f9faceee5b
2 changed files with 9 additions and 21 deletions
  1. 7 9
      panda/src/grutil/cardMaker.I
  2. 2 12
      panda/src/grutil/cardMaker.cxx

+ 7 - 9
panda/src/grutil/cardMaker.I

@@ -63,10 +63,10 @@ set_has_3d_uvs(bool flag) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void CardMaker::
 INLINE void CardMaker::
 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
-  _ll_pos.set(left,  0.0f, bottom);
-  _lr_pos.set(right, 0.0f, bottom);
-  _ur_pos.set(right, 0.0f, top);
-  _ul_pos.set(left,  0.0f, top);
+  _ll_pos = LVector3::rfu(left,  0.0f, bottom);
+  _lr_pos = LVector3::rfu(right, 0.0f, bottom);
+  _ur_pos = LVector3::rfu(right, 0.0f, top);
+  _ul_pos = LVector3::rfu(left,  0.0f, top);
 } 
 } 
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -85,8 +85,7 @@ set_frame(const LVecBase4 &frame) {
 //  Description: Sets the size of the card.
 //  Description: Sets the size of the card.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void CardMaker::
 INLINE void CardMaker::
-set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex &ul)
-{
+set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex &ul) {
   _ll_pos = ll;
   _ll_pos = ll;
   _lr_pos = lr;
   _lr_pos = lr;
   _ur_pos = ur;
   _ur_pos = ur;
@@ -101,9 +100,8 @@ set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex
 //               as a fullscreen quad.
 //               as a fullscreen quad.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void CardMaker::
 INLINE void CardMaker::
-set_frame_fullscreen_quad()
-{
-  set_frame(-1,1,-1,1);
+set_frame_fullscreen_quad() {
+  set_frame(-1.0f, 1.0f, -1.0f, 1.0f);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////

+ 2 - 12
panda/src/grutil/cardMaker.cxx

@@ -29,18 +29,8 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void CardMaker::
 void CardMaker::
 reset() {
 reset() {
-  _has_uvs = true;
-  _has_3d_uvs = false;
-
-  _ll_pos.set(0.0f, 0.0f, 0.0f);
-  _lr_pos.set(1.0f, 0.0f, 0.0f);
-  _ur_pos.set(1.0f, 0.0f, 1.0f);
-  _ul_pos.set(0.0f, 0.0f, 1.0f);
-
-  _ll_tex.set(0.0f, 0.0f, 0.0f);
-  _lr_tex.set(1.0f, 0.0f, 0.0f);
-  _ur_tex.set(1.0f, 1.0f, 0.0f);
-  _ul_tex.set(0.0f, 1.0f, 0.0f);
+  set_frame(0.0f, 1.0f, 0.0f, 1.0f);
+  set_uv_range(LTexCoord(0.0f, 0.0f), LTexCoord(1.0f, 1.0f));
 
 
   _has_color = false;
   _has_color = false;
   _color.set(1.0f, 1.0f, 1.0f, 1.0f);
   _color.set(1.0f, 1.0f, 1.0f, 1.0f);