Skip to content

Commit

Permalink
Added readme, updated include guard pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
BareRose committed Sep 16, 2018
1 parent 5e48ad0 commit 2c8b1d0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Documentation

This is a header-only library, as such most of its functional documentation is contained within the "header section" of the
source code in the form of comments. It is highly recommended that you read said documentation before using this library.

## Features

The dvector library provides both common and more specialized 2D/3D vector math operations, its features include:

- No hard dependencies besides the standard library, making it fully portable for most purposes
- Provides vec2, vec3, vec4, quat, mat2, mat3, and mat4 types with various important operations
- Supports an additional frst type along with frustum culling functions for spheres and AABBs
- All dvector types are pass-by-value, allowing for easy use as arguments or return values

## Attribution

You are not required to give attribution when using this library. If you want to give attribution anyway, either link to
this repository, [my website](https://www.slopegames.com/), or credit me as [BareRose](https://github.com/BareRose).
If you want to support me financially, consider giving to my [Patreon](https://www.patreon.com/slopegames).

## License

Licensed under CC0 aka the most lawyer-friendly way of spelling "public domain".
8 changes: 5 additions & 3 deletions dvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dvector functions:
All coordinate systems are right-handed unless otherwise noted. Projection functions assume OpenGL-style screen space.
*/

//include only once
//header section
#ifndef DVECTOR_H
#define DVECTOR_H

Expand Down Expand Up @@ -239,8 +239,11 @@ DVDEF frst frstFromMatrix(mat4);
DVDEF int frstCullSphere(frst, vec3, DVTYPE);
DVDEF int frstCullAABB(frst, vec3, vec3);

#endif //DVECTOR_H

//implementation section
#ifdef DVECTOR_IMPLEMENTATION
#undef DVECTOR_IMPLEMENTATION

//vec2 functions
DVDEF DVTYPE vec2Length (vec2 v) {
Expand Down Expand Up @@ -661,5 +664,4 @@ DVDEF int frstCullAABB (frst f, vec3 min, vec3 max) {
return 1;
}

#endif //DVECTOR_IMPLEMENTATION
#endif //DVECTOR_H
#endif //DVECTOR_IMPLEMENTATION

0 comments on commit 2c8b1d0

Please sign in to comment.