AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
GravityField.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/Component.h>
20#include <agx/Vec3.h>
21
23
24namespace agx
25{
26 class Task;
27
38 {
39 public:
41
47 virtual agx::Vec3 calculateGravity( const agx::Vec3& position ) const = 0;
48
49 public:
51 virtual Task* createRigidBodyTask() = 0;
52
55
57
58 protected:
59 virtual void store( agxStream::OutputArchive& out ) const override;
60 virtual void restore( agxStream::InputArchive& in ) override;
61
63 virtual ~GravityField();
64 };
65
66} //namespace agx
67
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXPHYSICS_EXPORT
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:39
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
Definition: GravityField.h:38
virtual void restore(agxStream::InputArchive &in) override
virtual Task * createParticleSystemTask()=0
Internal use.
virtual agx::Vec3 calculateGravity(const agx::Vec3 &position) const =0
Given position, a gravity acceleration will be calculated and returned.
virtual void store(agxStream::OutputArchive &out) const override
virtual Task * createRigidBodyTask()=0
Internal use.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agx::GravityField)
virtual ~GravityField()
Destructor.
A representation of a generic task.
Definition: Task.h:57
The agx namespace contains the dynamics/math part of the AGX Dynamics API.