瀏覽代碼

ode: Add set_first_contact and set_backface_cull to OdeRayGeom

Also deprecated get_params and set_params
rdb 5 天之前
父節點
當前提交
f24bcf9739
共有 2 個文件被更改,包括 14 次插入2 次删除
  1. 10 0
      panda/src/ode/odeRayGeom.I
  2. 4 2
      panda/src/ode/odeRayGeom.h

+ 10 - 0
panda/src/ode/odeRayGeom.I

@@ -63,6 +63,11 @@ get_params(int &first_contact, int &backface_cull) const {
   dGeomRayGetParams(_id, &first_contact, &backface_cull);
 }
 
+INLINE void OdeRayGeom::
+set_first_contact(int first_contact) {
+  dGeomRaySetFirstContact(_id, first_contact);
+}
+
 INLINE int OdeRayGeom::
 get_first_contact() const {
   int fc, bc;
@@ -70,6 +75,11 @@ get_first_contact() const {
   return fc;
 }
 
+INLINE void OdeRayGeom::
+set_backface_cull(int backface_cull) {
+  dGeomRaySetBackfaceCull(_id, backface_cull);
+}
+
 INLINE int OdeRayGeom::
 get_backface_cull() const {
   int fc, bc;

+ 4 - 2
panda/src/ode/odeRayGeom.h

@@ -41,9 +41,11 @@ PUBLISHED:
   INLINE void get(LVecBase3f &start, LVecBase3f &dir) const;
   INLINE LVecBase3f get_start() const;
   INLINE LVecBase3f get_direction() const;
-  INLINE void set_params(int first_contact, int backface_cull);
-  INLINE void get_params(int &first_contact, int &backface_cull) const;
+  [[deprecated]] INLINE void set_params(int first_contact, int backface_cull);
+  [[deprecated]] INLINE void get_params(int &first_contact, int &backface_cull) const;
+  INLINE void set_first_contact(int first_contact);
   INLINE int get_first_contact() const;
+  INLINE void set_backface_cull(int backface_cull);
   INLINE int get_backface_cull() const;
   INLINE void set_closest_hit(int closest_hit);
   INLINE int get_closest_hit();