Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94254659
matpoint.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Dec 5, 04:24
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Dec 7, 04:24 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22752825
Attached To
rSYMKIT symkit
matpoint.cpp
View Options
#include "matpoint.h"
MatPoint
::
MatPoint
(
sid_t
sid
,
double
mass
,
const
Vector
&
loc
,
const
std
::
string
label
,
const
struct
render_s
*
flags
)
:
Shape
(
sid
,
label
,
flags
)
{
this
->
particle
=
new
Particle
(
mass
,
loc
);
}
MatPoint
::
MatPoint
(
sid_t
sid
,
const
Particle
&
particle
,
const
std
::
string
label
,
const
struct
render_s
*
flags
)
:
Shape
(
sid
,
label
,
flags
)
{
this
->
particle
=
new
Particle
(
particle
);
}
MatPoint
::~
MatPoint
()
{
delete
this
->
particle
;
}
double
MatPoint
::
mass
()
const
{
return
particle
->
mass
;
}
const
Vector
&
MatPoint
::
speed
()
const
{
return
particle
->
speed
;
}
const
Vector
&
MatPoint
::
position
()
const
{
return
particle
->
position
;
}
Particle
MatPoint
::
getParticle
()
const
{
return
*
(
this
->
particle
);
}
void
MatPoint
::
setPosition
(
const
Vector
&
pos
)
{
this
->
particle
->
position
=
pos
;
}
void
MatPoint
::
move
(
const
Vector
&
delta
)
{
this
->
particle
->
position
+=
delta
;
}
void
MatPoint
::
setSpeed
(
const
Vector
&
speed
)
{
this
->
particle
->
speed
=
speed
;
}
void
MatPoint
::
setMass
(
double
mass
)
{
this
->
particle
->
mass
=
mass
;
}
Event Timeline
Log In to Comment