ToolPlugin -> Snapping?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/04/2011 at 15:05, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R12 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
Hey Guys,

How can I use Snapping for my Toolplugin? There is no where an example.

How to use that function:

void Init(BaseDocument* t_doc, BaseDraw* t_clip, BaseObject* t_aop, const Vector& initial, LONG initial_pid, Bool selftest, Bool axismode, Bool allow_cplane)

point position and point index of what - the op?

When I check IsEnabled(doc) I got true. But when I use SnapTo(v1,v2) Cinema 4D crashes.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2011 at 01:47, xxxxxxxx wrote:

Here is a little example how I use DetectSnapping in one of my tools.

  
// code from within my tool's Draw() method  
  
...  
  
AutoAlloc<DetectSnapping> snap;  
if (!snap) return FALSE;  
snap->Init(doc, bd, NULL, Vector(), 0, FALSE, TRUE, TRUE);  
  
...  
  
Vector delta;  
  
// pos is a vector in world space  
if (snap->SnapTo(pos, &delta))  
{  
  pos += delta;  
}  
  
...  

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2011 at 03:10, xxxxxxxx wrote:

Thank you Matthias,
I will try it out.