50 return ((
LinkState*)tag)->hasMemorizedRestDist;
56 typedef std::pair<utils::Point32f,utils::Point32f>
LinkCoords;
61 bool enableSelfCollision,
66 float initialStiffness=-1,
67 float initialMaxLinkDistnace=0.5);
105 const std::vector<utils::Point32f>
getTexCoords()
const;
void computeSmoothNormals()
The General Function Template.
Definition: Function.h:284
static bool is_first_order(void *tag)
Definition: PhysicsPaper3 (copy).h:43
bool hitTriangle(btSoftBody::Face *f, const utils::Point32f &a, const utils::Point32f &b)
void setFacesVisible(bool visible)
int b
Definition: PhysicsPaper3 (copy).h:125
undocument this line if you encounter any issues!
Definition: Any.h:37
void simulateSelfCollision()
bool isFold
Definition: PhysicsPaper3 (copy).h:40
void updateSmoothNormalGraph()
A physical world that handles physical objects.
Definition: PhysicsWorld.h:56
void updateToSceneObject(SceneObject *obj)
void movePosition(const utils::Point32f &coords, const geom::Vec &target, float streangth=1, float radius=0.1)
std::vector< geom::Vec > vertices
Definition: PhysicsPaper3 (copy).h:127
utils::Point32f hit(const geom::ViewRay &ray) const
static bool has_memorized_rest_dist(void *tag)
Definition: PhysicsPaper3 (copy).h:49
Definition: PhysicsPaper3 (copy).h:29
const core::Img32f & getFoldMap() const
void addTriangle(int a, int b, int c)
Camera class.
Definition: Camera.h:132
void adaptFoldStiffness(const LinkCoords &coords, float stiffness, bool memorize=false)
adapts the stiffness of a given fold (optionally memorizes deformation)
utils::Point32f hit(const geom::ViewRay &ray) const
returns paper coordinates of given (or Point(-1,-1) in case of no hit)
std::pair< utils::Point32f, utils::Point32f > LinkCoords
Definition: PhysicsPaper3 (copy).h:56
const std::vector< utils::Point32f > getTexCoords() const
void updateCollisionClusters()
void serializeStructureTo(std::ostream &str)
geom::Vec interpolatePosition(const utils::Point32f &p) const
std::vector< utils::Point32f > texCoords
Definition: PhysicsPaper3 (copy).h:126
SceneObject * approximateSurface(int nx=100, int ny=150) const
Definition: PhysicsPaper3 (copy).h:124
LinkState * p() const
Definition: PhysicsPaper3 (copy).h:42
LinkState(bool isFirstOrder=true, bool isFold=false, bool hasMemorizedRestDist=false)
Definition: PhysicsPaper3 (copy).h:35
Definition: PhysicsPaper3 (copy).h:125
void setStraightenFolds(bool enabled)
sets whether folds are always straightened
void createBendingConstraints(float maxDistance, float fixedStiffness=-1)
if fixedStiffness is in ]0,1], it is use for all links
Size class of the ICL.
Definition: Size.h:61
bool replaceTriangle(btSoftBody::Face *f, const utils::Point32f &a, const utils::Point32f &b)
virtual void updateSceneObject()
this method is used to update the visualization object from the physical object
utils::SmartPtr< LinkCoords > getLinkCoords(const utils::Point32f &pix, const geom::Camera &cam) const
returns the possible paper coords of link at given camera pixel
geom::Vec interpolatePosition(const utils::Point32f &p) const
bool isFirstOrder
Definition: PhysicsPaper3 (copy).h:39
int a
Definition: PhysicsPaper3 (copy).h:125
ICLQt_API void pix(ImgQ &image, int x, int y)
draw a single pixel into an image
int c
Definition: PhysicsPaper3 (copy).h:125
void addVertexOrReuseOldOne(utils::Point32f &t, btVector3 &v, int &idx)
PhysicsPaper3(PhysicsWorld *world, bool enableSelfCollision, const utils::Size &cellsInit, const geom::Vec corners[4]=0, const core::Img8u *front_texture=0, const core::Img8u *back_texture=0, float initialStiffness=-1, float initialMaxLinkDistnace=0.5)
std::string str(const T &t)
convert a data type into a string using an std::ostringstream instance
Definition: StringUtils.h:136
Abstract class for visualization tasks.
Definition: VisualizationDescription.h:73
core::Img32f paperCoordinateTest(const geom::Camera &cam) const
This is a view-ray's line equation in parameter form.
Definition: ViewRay.h:49
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
This class combines a soft-body physics object and it's graphical representation in ICL.
Definition: SoftObject.h:46
static bool is_fold(void *tag)
Definition: PhysicsPaper3 (copy).h:46
bool hitLink(btSoftBody::Link *l, const utils::Point32f &a, const utils::Point32f &b)
std::vector< Face > faces
Definition: PhysicsPaper3 (copy).h:128
void addLink(int a, int b, float stiffness=1.0f, const LinkState &state=LinkState())
virtual void customRender()
this function is called when an object is rendered
void setLinksVisible(bool visible)
utils::VisualizationDescription getFoldLineHighlight(const LinkCoords &coords, const geom::Camera &currCam) const
highlights all folds colliniear with line ab in paper space
static void free_link_state(void *p)
Definition: PhysicsPaper3 (copy).h:93
bool hasMemorizedRestDist
Definition: PhysicsPaper3 (copy).h:41
void splitAlongLine(const utils::Point32f &a, const utils::Point32f &b, const geom::Camera &currCam)
void setDoubleFolds(bool enabled)
sets whether folds are automatically inserted doubled
Data * m_data
Definition: PhysicsPaper3 (copy).h:31
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75
Definition: PhysicsPaper3 (copy).h:34
void setFoldMapChangedCallback(utils::Function< void, const core::Img32f & > cb)
void deserializeFrom(std::istream &str)
ICLGeom_API SceneObject()
create an object