Coder Social home page Coder Social logo

departurenow / physika Goto Github PK

View Code? Open in Web Editor NEW

This project forked from physikateam/physika-old

0.0 0.0 0.0 179.84 MB

PhysIKA: Physics-based Interactive Kinematics Architecture

License: GNU General Public License v2.0

C++ 71.02% C 22.60% CMake 0.58% Python 2.62% Makefile 0.03% Cuda 1.84% Objective-C 0.29% GLSL 0.04% HLSL 0.01% Starlark 0.12% Shell 0.19% HTML 0.67%

physika's Introduction

master: Build Status dev: Build Status

Introduction

PhysIKA is an open source node-based architecture targeted at real-time simulation of versatile physical materials. Currently, it supports simulating physical phenomena ranging from fluids, elastic objects and fracture, etc. It is higly modualized and can also help the research community develop more novel algorithms.

Getting Started

The following instructions will guide you to set up an simple elastic object.

Prerequisites

  • CUDA 9.0 +
  • CMake 3.12 +

Installing

  • Download the source code;
  • Run cmake and set up both "Where is the source code" and "Where to build the binaries";
  • Click Configure;
  • If succeeded, then click Generate.

Runing an example

The following example shows how to create an elastic bunny within less than 30 lines of codes.

#include <iostream>
#include "GUI/GlutGUI/GLApp.h"
#include "Framework/Framework/SceneGraph.h"
#include "Dynamics/ParticleSystem/ParticleElasticBody.h"
#include "Dynamics/ParticleSystem/StaticBoundary.h"

using namespace Physika;

int main()
{
	SceneGraph& scene = SceneGraph::getInstance();

	std::shared_ptr<StaticBoundary<DataType3f>> root = scene.createNewScene<StaticBoundary<DataType3f>>();
	root->loadCube(Vector3f(0), Vector3f(1), true);

	std::shared_ptr<ParticleElasticBody<DataType3f>> bunny = std::make_shared<ParticleElasticBody<DataType3f>>();
	root->addParticleSystem(bunny);
	bunny->getRenderModule()->setColor(Vector3f(0, 1, 1));
	bunny->setMass(1.0);
	bunny->loadParticles("../Media/bunny/bunny_points.obj");
	bunny->loadSurface("../Media/bunny/bunny_mesh.obj");
	bunny->translate(Vector3f(0.5, 0.2, 0.5));
	bunny->setVisible(false);

	GLApp window;
	window.createWindow(1024, 768);

	window.mainLoop();

	return 0;
}

The following image shows an screenshot of the running example

Contributers

Current developers:

  • He Xiaowei - Institute of Software, CAS
  • Xu Liyou - Peking University
  • Chen Xiaosong Tsinghua University

See also the list of contributors who are currently participated in this project.

Former developers:

  • Chen Wei
  • Zhu Fei
  • Yang Sheng
  • Zhang Tianxiang

License

This project is licensed under the GNU License - see the LICENSE file for details

physika's People

Contributors

feizhu avatar suitmyself avatar clouddon avatar tianxiangzhang avatar mikexupku avatar vovery avatar changy1506 avatar xchern avatar faraway1112 avatar xshuisheng avatar xshuis avatar nurshat317 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.