1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/********************************************************************
*
*	Created:	15/4/2014   15:28
*
*	File:		fsCHookedLineTrailComponent.h
*
*	Author:		Mick Waites
*	
*	Purpose:	
*
*********************************************************************/

#ifndef fsCHookedLineTrailComponenthdr
#define fsCHookedLineTrailComponenthdr

#include <fsCore/fsVec2d.h>
#include <fsCore/fsPoint.h>

#include "fsITrailComponent.h"

class fsCBezierPath;

class fsCHookedLineTrailComponent : public fsITrailComponent
{
	friend class fsCComponentFactory;

public:

	static fsF32 distanceBetweenPoints(const fsVec2d& pKnotA, const fsVec2d& pKnotB);
	static fsVec2d midPoint(const fsVec2d& pStart, const fsVec2d& pEnd);

	static const fsCUniqueId mTypeId;

protected:

	static fsIComponent* create(fsCEntity* pParent);

	void initialiseDo(const fsPoint& pStartPos, const fsPoint& pEndPos) override;
	void updateDo() override;

	fsCHookedLineTrailComponent(fsCEntity* pParent);
	virtual ~fsCHookedLineTrailComponent();<--- Destructor in derived class

private:

	fsCBezierPath* mPath;
};

#endif